ntp/ntp.spec

Thu, 04 Oct 2012 20:34:54 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:34:54 +0200
changeset 719
c1c586743518
child 720
7cbb7c0c025b
permissions
-rw-r--r--

Import package vendor original spec for necessary manipulations.

     1 ##
     2 ##  ntp.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2011 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 version
    25 %define       V_major 4
    26 %define       V_minor 2
    27 %define       V_micro 6p5
    29 #   package information
    30 Name:         ntp
    31 Summary:      Network Time Protocol (NTP) Daemon
    32 URL:          http://www.ntp.org/
    33 Vendor:       David L. Mills
    34 Packager:     OpenPKG Foundation e.V.
    35 Distribution: OpenPKG Community
    36 Class:        CORE
    37 Group:        Network
    38 License:      BSD-style
    39 Version:      %{V_major}.%{V_minor}.%{V_micro}
    40 Release:      20111226
    42 #   package options
    43 %option       with_fsl     yes
    44 %option       with_crypto  yes
    45 %option       with_sntp    yes
    46 %option       with_local   yes
    48 #   list of sources
    49 Source0:      http://www.eecis.udel.edu/~ntp/ntp_spool/ntp%{V_major}/ntp-%{version}.tar.gz
    50 Source1:      ntp-doc.tar.gz
    51 Source2:      ntp.conf
    52 Source3:      rc.ntp
    53 Source4:      fsl.ntp
    55 #   build information
    56 BuildPreReq:  OpenPKG, openpkg >= 20100101, make
    57 PreReq:       OpenPKG, openpkg >= 20100101
    58 %if "%{with_fsl}" == "yes"
    59 BuildPreReq:  fsl
    60 PreReq:       fsl
    61 %endif
    62 %if "%{with_crypto}" == "yes"
    63 BuildPreReq:  openssl, gcc
    64 PreReq:       openssl
    65 %endif
    67 %description
    68     The Network Time Protocol (NTP) is used to synchronize the time
    69     of a computer client or server to another server or reference
    70     time source, such as a radio or satellite receiver or modem. It
    71     provides accuracies typically within a millisecond on LANs and
    72     up to a few tens of milliseconds on WANs relative to Coordinated
    73     Universal Time (UTC) via a Global Positioning Service (GPS)
    74     receiver, for example. Typical NTP configurations utilize multiple
    75     redundant servers and diverse network paths in order to achieve high
    76     accuracy and reliability. Some configurations include cryptographic
    77     authentication to prevent accidental or malicious protocol attacks
    78     and some provide automatic server discovery using IP multicast.
    80 %track
    81     prog ntp = {
    82         version   = %{version}
    83         url       = http://www.ntp.org/downloads.html
    84         regex     = ntp-(\d+\.\d+\.\d+(p\d+)?)\.tar\.gz
    85     }
    87 %prep
    88     %setup -q
    89     %setup -q -T -D -a 1
    91 %build
    92     #   configure program
    93     ( case "%{l_platform -t}" in
    94           *-netbsd* ) echo "ac_cv_header_sys_soundcard_h=no" >>config.cache ;;
    95       esac
    96     ) >config.cache
    97     %{l_shtool} subst \
    98         -e 's;\(CFLAGS="$CFLAGS -W.*\);#\1;g' \
    99         configure
   100     AUTOCONF=true \
   101     AUTOMAKE=true \
   102     ACLOCAL=true \
   103     AUTOHEADER=true \
   104     CC="%{l_cc}" \
   105     CFLAGS="%{l_cflags -O}" \
   106     LDFLAGS="%{l_fsl_ldflags}" \
   107 %if "%{with_crypto}" == "yes"
   108     LIBS="%{l_fsl_libs} -lcrypto" \
   109 %else
   110     LIBS="%{l_fsl_libs}" \
   111 %endif
   112     ./configure \
   113         --cache-file=./config.cache \
   114         --prefix=%{l_prefix} \
   115         --mandir=%{l_prefix}/man \
   116 %if "%{with_sntp}" == "yes"
   117         --with-sntp \
   118 %endif
   119 %if "%{with_local}" == "yes"
   120         --enable-LOCAL-CLOCK \
   121 %endif
   122 %if "%{with_crypto}" == "yes"
   123         --with-crypto \
   124         --with-openssl-libdir=%{l_prefix}/lib \
   125         --with-openssl-incdir=%{l_prefix}/include \
   126 %else
   127         --without-crypto \
   128         --without-openssl-libdir \
   129         --without-openssl-incdir \
   130 %endif
   131         --enable-ntpdate-step \
   132         --without-lineeditlibs \
   133         --without-net-snmp-config \
   134         --without-ntpsnmpd
   135     %{l_shtool} subst \
   136         -e 's;\(CONFIG_FILE[^"]*"\)/etc/ntp.conf;\1%{l_prefix}/etc/ntp/ntp.conf;' \
   137         include/ntp_config.h ntpdate/ntptime_config.c
   139     #   build program
   140     %{l_make} %{l_mflags -O}
   142 %install
   143     #   install program
   144     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   146     #   install manual pages
   147     ( cd ntp-doc
   148       %{l_shtool} mkdir -f -p -m 755 \
   149           $RPM_BUILD_ROOT%{l_prefix}/man/man5
   150       %{l_shtool} install -c -m 644 \
   151           *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
   152       %{l_shtool} mkdir -f -p -m 755 \
   153           $RPM_BUILD_ROOT%{l_prefix}/man/man8
   154       %{l_shtool} install -c -m 644 *.8 \
   155           $RPM_BUILD_ROOT%{l_prefix}/man/man8/
   156     ) || exit $?
   158     #   install default configuration
   159     %{l_shtool} mkdir -f -p -m 755 \
   160         $RPM_BUILD_ROOT%{l_prefix}/etc/ntp
   161     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   162         %{SOURCE ntp.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ntp/
   164     #   post-adjust installation
   165     %{l_shtool} mkdir -f -p -m 755 \
   166         $RPM_BUILD_ROOT%{l_prefix}/var/ntp/ntpd.stat
   167     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   169     #   install run-command script
   170     %{l_shtool} mkdir -f -p -m 755 \
   171         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   172     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   173         %{SOURCE rc.ntp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   175     #   install OSSP fsl configuration
   176     %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   177     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   178         %{SOURCE fsl.ntp} \
   179         $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   181     #   determine installation files
   182     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   183         %{l_files_std} \
   184         '%config %{l_prefix}/etc/fsl/fsl.ntp' \
   185         '%config %{l_prefix}/etc/ntp/ntp.conf'
   187 %files -f files
   189 %clean
   191 %post
   192     #   after upgrade, restart service
   193     [ $1 -eq 2 ] || exit 0
   194     eval `%{l_rc} ntp status 2>/dev/null`
   195     [ ".$ntp_active" = .yes ] && %{l_rc} ntp restart
   196     exit 0
   198 %preun
   199     #   before erase, stop service and remove log files
   200     [ $1 -eq 0 ] || exit 0
   201     %{l_rc} ntp stop 2>/dev/null
   202     rm -f $RPM_INSTALL_PREFIX/var/ntp/ntp.log* >/dev/null 2>&1 || true
   203     exit 0

mercurial