{"id":35574,"date":"2025-12-01T08:40:33","date_gmt":"2025-12-01T05:40:33","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=35574"},"modified":"2025-12-01T08:40:33","modified_gmt":"2025-12-01T05:40:33","slug":"example-check-for-a-condition-before-installation","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/","title":{"rendered":"Example: Check for a condition before installation"},"content":{"rendered":"<p><body>FPM (Effing Package Management) is a fantastic tool for creating packages quickly and easily for various operating systems from a single source. It&#8217;s written in Ruby and acts as a package converter, letting you go from one package type (like a directory of files, a Ruby gem, a Python package) to another (like a .deb, .rpm, .tar.gz, etc.).<\/p>\n<p>The &#8220;multiple operating systems&#8221; part refers to the <em>output<\/em> package types. You&#8217;ll typically run FPM on a single build host (e.g., a Linux machine, or even a Docker container) to generate packages for Debian\/Ubuntu, RedHat\/CentOS, Arch Linux, etc.<\/p>\n<p>Here&#8217;s a comprehensive guide on how to use FPM effectively.<\/p>\n<p>&#8212;<\/p>\n<h3>What is FPM and Why Use It?<\/h3>\n<p>*   <strong>Simplicity:<\/strong> Drastically simplifies the process of creating <code>.deb<\/code> or <code>.rpm<\/code> packages, which can otherwise be quite complex with <code>dpkg-buildpackage<\/code> or <code>rpmbuild<\/code>.<br \/>\n*   <strong>Speed:<\/strong> Create a package in minutes, not hours.<br \/>\n*   <strong>Flexibility:<\/strong> Package almost anything: a directory of files, a Python application, a Ruby gem, a pre-built binary, etc.<br \/>\n*   <strong>Cross-Platform Output:<\/strong> Generate packages for Debian, Ubuntu, CentOS, RHEL, Fedora, Arch Linux, Solaris, macOS, and more, all from one command.<br \/>\n*   <strong>Automation:<\/strong> Easily integrate into CI\/CD pipelines.<\/p>\n<h3>Prerequisites<\/h3>\n<p>1.  <strong>Ruby:<\/strong> FPM is a Ruby gem, so you need Ruby installed.<br \/>\n    *   On Debian\/Ubuntu: <code>sudo apt update && sudo apt install ruby ruby-dev build-essential<\/code><br \/>\n    *   On CentOS\/RHEL: <code>sudo yum install ruby ruby-devel @development<\/code> (or <code>dnf<\/code> for newer versions)<br \/>\n    *   On macOS: Ruby is usually pre-installed, but it&#8217;s recommended to use a version manager like <code>rbenv<\/code> or <code>rvm<\/code>.<\/p>\n<p>2.  <strong>RubyGems:<\/strong> Ruby&#8217;s package manager, usually installed with Ruby.<\/p>\n<h3>Installation<\/h3>\n<p>Once Ruby is set up, install FPM:<\/p>\n<pre><code class=\"language-bash\">sudo gem install fpm<\/code><\/pre>\n<p><em>(You might need <code>sudo<\/code> depending on your Ruby installation. If you&#8217;re using <code>rbenv<\/code> or <code>rvm<\/code>, you likely won&#8217;t need <code>sudo<\/code>.)<\/em><\/p>\n<h3>Core Concepts and Essential Flags<\/h3>\n<p>FPM&#8217;s command structure is generally:<\/p>\n<pre><code class=\"language-bash\">fpm -s <source_type> -t <target_type> [options] <input_path(s)><\/code><\/pre>\n<p><em>   <strong><code>-s<source_type><\/code>:<\/strong> What are you packaging <\/em>from*?<br \/>\n    *   <code>dir<\/code>: (Most common) Package files from a directory.<br \/>\n    *   <code>gem<\/code>: Package a Ruby gem.<br \/>\n    *   <code>python<\/code>: Package a Python application (requires <code>setuptools<\/code>).<br \/>\n    *   <code>rpm<\/code>: Convert an RPM to another format.<br \/>\n    *   <code>deb<\/code>: Convert a DEB to another format.<br \/>\n    *   <code>cpan<\/code>: Package a Perl module.<br \/>\n    *   <code>npm<\/code>: Package a Node.js module.<br \/>\n    *   <code>tar<\/code>: Package a tarball.<br \/>\n    *   &#8230; and more.<br \/>\n*   <strong><code>-t <target_type><\/code>:<\/strong> What package format do you want to create?<br \/>\n    *   <code>deb<\/code>: Debian\/Ubuntu package.<br \/>\n    *   <code>rpm<\/code>: RedHat\/CentOS\/Fedora package.<br \/>\n    *   <code>tar<\/code>: Generic tarball.<br \/>\n    *   <code>zip<\/code>: Generic zip archive.<br \/>\n    *   <code>pkg<\/code>: macOS package.<br \/>\n    *   <code>pacman<\/code>: Arch Linux package.<br \/>\n    *   <code>msi<\/code>: (Experimental) Windows Installer package.<br \/>\n    *   &#8230; and more.<br \/>\n*   <strong><code>-n <package_name><\/code>:<\/strong> The name of your package (e.g., <code>my-custom-app<\/code>).<br \/>\n*   <strong><code>-v <version><\/code>:<\/strong> The version of your package (e.g., <code>1.0.0<\/code>).<br \/>\n*   <strong><code>-p <output_path><\/code>:<\/strong> (Optional) Where to put the generated package file. Defaults to current directory.<br \/>\n*   <strong><code>-d \"<dependency_name>\"<\/code>:<\/strong> Add a dependency (e.g., <code>-d \"nginx\"<\/code> or <code>-d \"python3 >= 3.6\"<\/code>). You can specify multiple <code>-d<\/code> flags.<br \/>\n*   <strong><code>--description \"<text>\"<\/code>:<\/strong> A long description for your package.<br \/>\n*   <strong><code>--url \"<url>\"<\/code>:<\/strong> The URL for your project.<br \/>\n*   <strong><code>--license \"<license_type>\"<\/code>:<\/strong> The license under which your software is distributed (e.g., <code>MIT<\/code>, <code>GPLv3<\/code>).<br \/>\n*   <strong><code>--maintainer \"<name_and_email>\"<\/code>:<\/strong> The person or team maintaining the package.<br \/>\n*   <strong><code>--architecture <arch><\/code>:<\/strong> The target architecture (e.g., <code>amd64<\/code>, <code>x86_64<\/code>, <code>all<\/code>, <code>noarch<\/code>).<br \/>\n*   <strong><code>--iteration <release_number><\/code>:<\/strong> The package release number (e.g., <code>1<\/code>, <code>2.el7<\/code>). Useful for distinguishing package builds of the same software version.<br \/>\n*   <strong><code>--prefix <path><\/code>:<\/strong> Install files into this directory within the package (e.g., <code>\/opt\/my-app<\/code>). Defaults to <code>\/<\/code> for <code>dir<\/code> source.<br \/>\n*   <strong><code>-C <directory><\/code> or <code>--chdir <directory><\/code>:<\/strong> Change to this directory before packaging. Very useful when packaging a directory.<br \/>\n*   <strong><code>--input-type<\/code> and <code>--output-type<\/code>:<\/strong> Aliases for <code>-s<\/code> and <code>-t<\/code>.<\/p>\n<h3>Step-by-Step Examples<\/h3>\n<p>Let&#8217;s say you have a simple application structure:<\/p>\n<pre><code class=\"language-\">my-app-src\/\n\u251c\u2500\u2500 bin\/\n\u2502   \u2514\u2500\u2500 myapp.sh\n\u251c\u2500\u2500 etc\/\n\u2502   \u2514\u2500\u2500 myapp.conf\n\u2514\u2500\u2500 lib\/\n    \u2514\u2500\u2500 myapp.py<\/code><\/pre>\n<p>And <code>myapp.sh<\/code> looks like this:<\/p>\n<pre><code class=\"language-bash\">#!\/bin\/bash\necho \"Hello from My App v1.0.0!\"\ncat \/etc\/myapp\/myapp.conf<\/code><\/pre>\n<p>And <code>myapp.conf<\/code>:<\/p>\n<pre><code class=\"language-\">APP_SETTING=\"default_value\"<\/code><\/pre>\n<p>### 1. Preparing Your Files (Staging Directory)<\/p>\n<p>It&#8217;s best practice to organize your files in a &#8220;staging&#8221; directory that mirrors the final installation path <em>within<\/em> the target system.<\/p>\n<pre><code class=\"language-bash\">mkdir -p \/tmp\/my-app-staging\/opt\/myapp\/bin\nmkdir -p \/tmp\/my-app-staging\/etc\/myapp\n\ncp my-app-src\/bin\/myapp.sh \/tmp\/my-app-staging\/opt\/myapp\/bin\/\ncp my-app-src\/etc\/myapp.conf \/tmp\/my-app-staging\/etc\/myapp\/\ncp my-app-src\/lib\/myapp.py \/tmp\/my-app-staging\/opt\/myapp\/lib\/<\/code><\/pre>\n<p>Now, <code>\/tmp\/my-app-staging<\/code> looks like this:<\/p>\n<pre><code class=\"language-\">\/tmp\/my-app-staging\/\n\u251c\u2500\u2500 etc\/\n\u2502   \u2514\u2500\u2500 myapp\/\n\u2502       \u2514\u2500\u2500 myapp.conf\n\u2514\u2500\u2500 opt\/\n    \u2514\u2500\u2500 myapp\/\n        \u251c\u2500\u2500 bin\/\n        \u2502   \u2514\u2500\u2500 myapp.sh\n        \u2514\u2500\u2500 lib\/\n            \u2514\u2500\u2500 myapp.py<\/code><\/pre>\n<p>### 2. Creating a Debian (.deb) Package<\/p>\n<pre><code class=\"language-bash\">fpm -s dir -t deb \\\n  -n \"my-custom-app\" \\\n  -v \"1.0.0\" \\\n  --iteration \"1\" \\\n  --architecture \"amd64\" \\\n  --description \"A simple custom application.\" \\\n  --url \"https:\/\/example.com\/my-app\" \\\n  --license \"MIT\" \\\n  --maintainer \"Your Name <your.email@example.com>\" \\\n  -d \"bash\" \\\n  -d \"python3\" \\\n  -C \/tmp\/my-app-staging\/ \\\n  .<\/code><\/pre>\n<p><em>   <code>-C \/tmp\/my-app-staging\/<\/code>: Tells FPM to change into this directory <\/em>before* packaging.<br \/>\n*   <code>.<\/code>: This tells FPM to package everything in the current directory (which is now <code>\/tmp\/my-app-staging<\/code> due to <code>-C<\/code>).<\/p>\n<p>This will output a file like <code>my-custom-app_1.0.0-1_amd64.deb<\/code>.<\/p>\n<p>To install and test:<\/p>\n<pre><code class=\"language-bash\">sudo dpkg -i my-custom-app_1.0.0-1_amd64.deb\n\/opt\/myapp\/bin\/myapp.sh<\/code><\/pre>\n<p>### 3. Creating a RedHat\/CentOS (.rpm) Package<\/p>\n<p>Using the <em>exact same staging directory<\/em> and almost the same command:<\/p>\n<pre><code class=\"language-bash\">fpm -s dir -t rpm \\\n  -n \"my-custom-app\" \\\n  -v \"1.0.0\" \\\n  --iteration \"1.el7\" \\\n  --architecture \"x86_64\" \\\n  --description \"A simple custom application.\" \\\n  --url \"https:\/\/example.com\/my-app\" \\\n  --license \"MIT\" \\\n  --maintainer \"Your Name <your.email@example.com>\" \\\n  -d \"bash\" \\\n  -d \"python3\" \\\n  -C \/tmp\/my-app-staging\/ \\\n  .<\/code><\/pre>\n<p>*   <code>--iteration \"1.el7\"<\/code>: A common convention for RPMs indicating the release number and the target OS (Enterprise Linux 7).<br \/>\n*   <code>--architecture \"x86_64\"<\/code>: Standard for 64-bit RPMs.<\/p>\n<p>This will output a file like <code>my-custom-app-1.0.0-1.el7.x86_64.rpm<\/code>.<\/p>\n<p>To install and test:<\/p>\n<pre><code class=\"language-bash\">sudo yum install my-custom-app-1.0.0-1.el7.x86_64.rpm\n\/opt\/myapp\/bin\/myapp.sh<\/code><\/pre>\n<p><em>(Note: <code>yum<\/code> or <code>dnf<\/code> will handle dependencies automatically if they are in configured repositories.)<\/em><\/p>\n<p>### 4. Adding Pre\/Post-Install Scripts<\/p>\n<p>You can execute scripts at various stages of the package lifecycle.<\/p>\n<p>Create script files (e.g., <code>preinstall.sh<\/code>, <code>postinstall.sh<\/code>):<\/p>\n<p><strong><code>preinstall.sh<\/code>:<\/strong><\/p>\n<pre><code class=\"language-bash\">#!\/bin\/bash\necho \"Running pre-install script for my-custom-app...\"\n<h2>Example: Check for a condition before installation<\/h2>\nif [ -f \/opt\/myapp\/bin\/myapp.sh ]; then\n  echo \"My App already exists, upgrading.\"\nelse\n  echo \"Installing My App for the first time.\"\nfi\nexit 0<\/code><\/pre>\n<p><strong><code>postinstall.sh<\/code>:<\/strong><\/p>\n<pre><code class=\"language-bash\">#!\/bin\/bash\necho \"Running post-install script for my-custom-app...\"\n<h2>Example: Create a symlink or start a service<\/h2>\nif [ ! -f \/usr\/local\/bin\/myapp ]; then\n  sudo ln -s \/opt\/myapp\/bin\/myapp.sh \/usr\/local\/bin\/myapp\n  echo \"Created symlink \/usr\/local\/bin\/myapp\"\nfi\necho \"Installation complete!\"\nexit 0<\/code><\/pre>\n<p>Now, add them to your FPM command:<\/p>\n<pre><code class=\"language-bash\">fpm -s dir -t deb \\\n  -n \"my-custom-app\" -v \"1.0.0\" --iteration \"1\" --architecture \"amd64\" \\\n  --description \"A simple custom application with scripts.\" \\\n  --url \"https:\/\/example.com\/my-app\" --license \"MIT\" \\\n  --maintainer \"Your Name <your.email@example.com>\" \\\n  -d \"bash\" -d \"python3\" \\\n  --before-install preinstall.sh \\\n  --after-install postinstall.sh \\\n  -C \/tmp\/my-app-staging\/ \\\n  .<\/code><\/pre>\n<p><em>   <code>--before-install <path_to_script><\/code>: Runs <\/em>before* files are installed.<br \/>\n<em>   <code>--after-install <path_to_script><\/code>: Runs <\/em>after* files are installed.<br \/>\n*   Other options: <code>--before-remove<\/code>, <code>--after-remove<\/code>, <code>--before-upgrade<\/code>, <code>--after-upgrade<\/code>.<\/p>\n<p>### 5. Packaging a Python Application<\/p>\n<p>If you have a Python project with a <code>setup.py<\/code> or <code>pyproject.toml<\/code>:<\/p>\n<pre><code class=\"language-bash\"># In your python_app_root_dir\/\nfpm -s python -t deb \\\n  -n \"my-python-app\" \\\n  -v \"0.5.0\" \\\n  --iteration \"1\" \\\n  --architecture \"all\" \\\n  --description \"A Python application packaged by FPM.\" \\\n  --python-bin \/usr\/bin\/python3 \\\n  --python-pip \/usr\/bin\/pip3 \\\n  . # Packages the current directory as a Python source<\/code><\/pre>\n<p>*   <code>--python-bin<\/code> and <code>--python-pip<\/code>: Specify the Python executable and pip to use for building.<br \/>\n*   <code>--architecture \"all\"<\/code>: Often appropriate for pure Python apps.<\/p>\n<p><strong>Alternative (and often more robust) for Python apps:<\/strong><br \/>\n1.  Install your Python app into a staging directory:<\/p>\n<pre><code class=\"language-bash\">mkdir -p \/tmp\/python-staging\n    pip install . --prefix=\/usr\/local --root=\/tmp\/python-staging<\/code><\/pre>\n<p>2.  Then package the staging directory using <code>fpm -s dir<\/code>:<\/p>\n<pre><code class=\"language-bash\">fpm -s dir -t deb \\\n      -n \"my-python-app\" -v \"0.5.0\" --iteration \"1\" --architecture \"all\" \\\n      --description \"A Python application via dir source.\" \\\n      -d \"python3\" \\\n      -C \/tmp\/python-staging\/ \\\n      .<\/code><\/pre>\n<p>    This approach gives you more control over the final file layout.<\/p>\n<p>### 6. Marking Configuration Files<\/p>\n<p>For files that users might modify (like <code>myapp.conf<\/code>), you want the package manager to handle upgrades gracefully (e.g., prompt to merge changes or preserve the user&#8217;s version).<\/p>\n<pre><code class=\"language-bash\">fpm -s dir -t deb \\\n  -n \"my-custom-app\" -v \"1.0.0\" --iteration \"1\" --architecture \"amd64\" \\\n  --description \"App with a config file.\" \\\n  --url \"https:\/\/example.com\/my-app\" --license \"MIT\" \\\n  --maintainer \"Your Name <your.email@example.com>\" \\\n  -d \"bash\" -d \"python3\" \\\n  --config-files \/etc\/myapp\/myapp.conf \\\n  -C \/tmp\/my-app-staging\/ \\\n  .<\/code><\/pre>\n<p>*   <code>--config-files <path_relative_to_package_root><\/code>: Marks the specified file as a configuration file.<\/p>\n<h3>Best Practices and Advanced Tips<\/h3>\n<p>*   <strong>Use a Staging Directory (<code>-C<\/code>):<\/strong> Always build your package contents in a temporary directory (<code>\/tmp\/my-app-staging<\/code> in our example) that directly reflects the final installation path. This makes your FPM commands cleaner and less error-prone.<br \/>\n*   <strong>Version Control:<\/strong> Keep your <code>my-app-src<\/code> and any build scripts under version control.<br \/>\n*   <strong>Automation:<\/strong> Integrate FPM into your build scripts (e.g., <code>Makefile<\/code>, <code>Rakefile<\/code>, shell scripts) or CI\/CD pipeline (Jenkins, GitLab CI, GitHub Actions) to automate package creation on every release or commit.<br \/>\n*   <strong>Docker for Build Consistency:<\/strong> To ensure your packages are built consistently and don&#8217;t pick up host-specific dependencies, use Docker.<\/p>\n<pre><code class=\"language-dockerfile\"># Dockerfile for building packages\n    FROM ruby:3.1-slim-buster\n    RUN apt-get update && apt-get install -y build-essential\n    RUN gem install fpm\n    WORKDIR \/build\n    COPY . \/build\n    # Now run your fpm command inside the container\n    CMD [\"fpm\", \"-s\", \"dir\", \"-t\", \"deb\", \"-n\", \"my-custom-app\", ...]<\/code><\/pre>\n<p>*   <strong><code>--prefix<\/code>:<\/strong> If you want all your files to be installed under a specific directory (e.g., <code>\/opt\/your-company\/my-app<\/code>), use <code>--prefix \/opt\/your-company\/my-app<\/code> and then <code>fpm -C \/tmp\/my-app-staging\/opt\/your-company\/my-app .<\/code>.<br \/>\n<em>   <strong><code>--exclude<\/code>:<\/strong> For <code>dir<\/code> sources, you can exclude files or directories using <code>--exclude \".git\" --exclude \"<\/em>.log\"<\/code>.<br \/>\n*   <strong>Signing Packages:<\/strong> For production environments, you&#8217;ll want to sign your <code>.deb<\/code> and <code>.rpm<\/code> packages for security and integrity verification. FPM itself doesn&#8217;t directly sign, but you can integrate <code>dpkg-sig<\/code> or <code>rpmsign<\/code> into your post-FPM build steps.<br \/>\n*   <strong>Complex Dependencies:<\/strong> For very complex dependency scenarios, you might still need to consult the native packaging tools&#8217; documentation (<code>dpkg<\/code> or <code>rpm<\/code>). FPM handles most common cases well.<br \/>\n*   <strong>Debugging:<\/strong> If your package isn&#8217;t working as expected, examine its contents:<br \/>\n    *   For <code>.deb<\/code>: <code>dpkg -c package.deb<\/code> (list contents), <code>dpkg -I package.deb<\/code> (show info).<br \/>\n    *   For <code>.rpm<\/code>: <code>rpm -qpl package.rpm<\/code> (list contents), <code>rpm -qpi package.rpm<\/code> (show info).<\/p>\n<p>&#8212;<\/p>\n<p>FPM is a powerful tool that significantly lowers the barrier to entry for creating system packages. By mastering the <code>dir<\/code> source type and understanding the common flags, you can efficiently package almost any application for multiple Linux distributions.<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"FPM (Effing Package Management) is a fantastic tool for creating packages quickly and easily for various operating systems from a single source. It&#8217;s","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-35574","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-genel","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Example: Check for a condition before installation - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Example: Check for a condition before installation\" \/>\n<meta property=\"og:description\" content=\"FPM (Effing Package Management) is a fantastic tool for creating packages quickly and easily for various operating systems from a single source. It&#039;s\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-01T05:40:33+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Example: Check for a condition before installation\",\"datePublished\":\"2025-12-01T05:40:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\"},\"wordCount\":1006,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\",\"name\":\"Example: Check for a condition before installation - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-12-01T05:40:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Example: Check for a condition before installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Example: Check for a condition before installation - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/","og_locale":"tr_TR","og_type":"article","og_title":"Example: Check for a condition before installation","og_description":"FPM (Effing Package Management) is a fantastic tool for creating packages quickly and easily for various operating systems from a single source. It's","og_url":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-12-01T05:40:33+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"8 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Example: Check for a condition before installation","datePublished":"2025-12-01T05:40:33+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/"},"wordCount":1006,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/","url":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/","name":"Example: Check for a condition before installation - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-12-01T05:40:33+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/example-check-for-a-condition-before-installation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Example: Check for a condition before installation"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/35574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=35574"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/35574\/revisions"}],"predecessor-version":[{"id":35575,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/35574\/revisions\/35575"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=35574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=35574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=35574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}