Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

support for static linking

  • Loading branch information...
commit 263f0b14d9135eaa38eb5437e318175654d9933b 1 parent 1ee466c
@maoe authored
Showing with 21 additions and 10 deletions.
  1. +21 −10 kc.spec
31 kc.spec
@@ -1,18 +1,23 @@
+# rpmbuild -ba kc.spec (build with static linking)
+# rpmbuild -ba kc.spec --without static (build with dynamic linking)
%global pkg_name kc
-# use "rpmbuild --with static" to enable static linking (off by default)
-%{?_with_static:%define STATIC_BUILD 1}
-%{!?_with_static:%define STATIC_BUILD 0}
+%bcond_without static
%bcond_without doc
%bcond_without prof
+%if %{with static}
+%define release_suffix static
+%define release_suffix %{?dist}
# ghc does not emit debug information
%global debug_package %{nil}
Name: %{pkg_name}
Version: 0.0.1
-Release: 1.%{?dist}
+Release: 2.%{release_suffix}
Summary: A command-line tool for keepalived.conf
Group: Applications/System
License: BSD
@@ -21,6 +26,9 @@ URL:{pkg_name}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# fedora ghc archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
+%if %{with static}
+Requires: gmp
BuildRequires: ghc, ghc-rpm-macros, ghc-text-keepalived
%if %{with doc}
BuildRequires: ghc-doc
@@ -43,11 +51,12 @@ fi
cd %{pkg_name}
-if [ %{STATIC_BUILD} -eq 0 ]; then
- %cabal_configure --ghc %{?with_prof:-p} -O2 -fvia-C -foptc-O2 -fstatic -foptl-static
- %cabal_configure --ghc %{?with_prof:-p} -O2 -fvia-C -foptc-O2
+%cabal clean
+%if %{with static}
+%cabal_configure --ghc %{?with_prof:-p} -O2 -fvia-C -foptc-O2 -fstatic -foptl-static
+%cabal_configure --ghc %{?with_prof:-p} -O2 -fvia-C -foptc-O2
%cabal build
@@ -67,5 +76,7 @@ rm -rf $RPM_BUILD_ROOT
+* Thu Nov 19 2009 Mitsutoshi Aoe <> - 0.0.1-2
+- support for static linking
* Thu Nov 19 2009 Mitsutoshi Aoe <> - 0.0.1-1
- initial revision

0 comments on commit 263f0b1

Please sign in to comment.
Something went wrong with that request. Please try again.