cfengine/cfengine.spec

Mon, 17 Sep 2012 19:10:10 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 17 Sep 2012 19:10:10 +0200
changeset 689
9fe04d4d4e5a
parent 562
fb1ea36eaee4
child 692
67831a9de168
permissions
-rw-r--r--

Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.

     1 ##
     2 ##  cfengine.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package information
    25 Name:         cfengine
    26 Summary:      Automated System Administration Tool
    27 URL:          http://www.cfengine.org/
    28 Vendor:       Oslo University College, Norway
    29 Packager:     OpenPKG Foundation e.V.
    30 Distribution: OpenPKG Community
    31 Class:        BASE
    32 Group:        System
    33 License:      GPL
    34 Version:      3.3.5
    35 Release:      20120800
    37 #   package options
    38 %option       with_fsl  yes
    40 #   list of sources
    41 Source0:      http://cfengine.com/source-code/download?file=cfengine-%{version}.tar.gz
    42 Source1:      rc.cfengine
    43 Source2:      fsl.cfengine
    45 #   build information
    46 BuildPreReq:  OpenPKG, openpkg >= 20100101, bison, flex, make, gcc, pkgconfig
    47 PreReq:       OpenPKG, openpkg >= 20100101
    48 BuildPreReq:  tokyocabinet, openssl, pcre
    49 PreReq:       tokyocabinet, openssl, pcre
    50 %if "%{with_fsl}" == "yes"
    51 BuildPreReq:  fsl
    52 PreReq:       fsl
    53 %endif
    55 %description
    56     Cfengine is a tool for setting up and maintaining BSD and System-5-like
    57     operating system optionally attached to a TCP/IP network. You can think
    58     of cfengine as a very high level language, much higher level than Perl
    59     or shell: a single statement can result in many hundreds of operations
    60     being performed on multiple hosts. Cfengine is good at performing a lot
    61     of common system administration tasks, and allows you to build on its
    62     strengths with your own scripts. You can also use it as a netwide
    63     front-end for `cron'.
    65 %track
    66     prog cfengine = {
    67         version   = %{version}
    68         url       = http://cfengine.com/source-code
    69         regex     = cfengine-(\d+.\d+\.\d+(p\d+)?)\.tar\.gz
    70     }
    72 %prep
    73     %setup -q
    74     %{l_shtool} subst \
    75         -e 's;\(LIBS=.*\)-ltokyocabinet;\1`%{l_prefix}/bin/pkg-config --libs-only-l tokyocabinet`;' \
    76         -e 's;\(LIBS=.*\)-lcrypto;\1`%{l_prefix}/bin/pkg-config --libs-only-l openssl`;' \
    77         configure
    78     %{l_shtool} subst \
    79         -e 's;\(masterfilesdir = \$(projdatadir)\)/CoreBase;\1/cfengine;' \
    80         masterfiles/Makefile.in
    82 %build
    83     #   configure package
    84     CC="%{l_cc}" \
    85     CFLAGS="%{l_cflags -O}" \
    86     CPPFLAGS="%{l_cppflags}" \
    87     LDFLAGS="%{l_fsl_ldflags}" \
    88     LIBS="%{l_fsl_libs}" \
    89     ./configure \
    90         --prefix=%{l_prefix} \
    91         --mandir=%{l_prefix}/man \
    92         --infodir=%{l_prefix}/info \
    93         --with-workdir=%{l_prefix}/var/cfengine \
    94         --with-tokyocabinet=%{l_prefix} \
    95         --with-openssl=%{l_prefix} \
    96         --with-pcre=%{l_prefix} \
    97         --without-sql \
    98         --disable-shared
   100     #   build package
   101     %{l_make} %{l_mflags -O}
   103 %install
   104     #   install package
   105     %{l_shtool} mkdir -f -p -m 755 \
   106         $RPM_BUILD_ROOT%{l_prefix}/var/cfengine
   107     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   109     #   strip down installation
   110     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true
   111     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true
   112     rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true
   113     strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
   115     #   install run-command script
   116     %{l_shtool} mkdir -f -p -m 755 \
   117         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   118     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   119         %{SOURCE rc.cfengine} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   121     #   install OSSP fsl configuration
   122     %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   123     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   124         %{SOURCE fsl.cfengine} \
   125         $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   127     #   determine installation files
   128     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   129         %{l_files_std} \
   130         '%config %{l_prefix}/etc/fsl/fsl.cfengine'
   132 %files -f files
   134 %clean
   136 %post
   137     #   generate a public/private key pair for localhost
   138     if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then
   139         $RPM_INSTALL_PREFIX/bin/cf-key
   140     fi

mercurial