| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- ##
- ## maradns.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_major 1.3
- %define V_minor 01
- # package information
- Name: maradns
- Summary: Authoritative & Caching DNS Server
- URL: http://www.maradns.org/
- Vendor: Sam Trenholme
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: DNS
- License: MIT-style
- Version: %{V_major}.%{V_minor}
- Release: 20061222
- # package options
- %option with_authonly no
- # list of sources
- Source0: http://www.maradns.org/download/%{V_major}/%{version}/maradns-%{version}.tar.gz
- Source1: rc.maradns
- Source2: mararc
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
- PreReq: OpenPKG, openpkg >= 20040130
- AutoReq: no
- AutoReqProv: no
- %description
- MaraDNS is a secure, full-featured and easy to use Domain Name
- Service (DNS) server supporting both the authoritative and recursive
- resolving and caching operations.
- %track
- prog maradns = {
- version = %{version}
- url = http://www.maradns.org/download.html
- regex = maradns-(__VER__)\.tar\.(gz|bz2)
- }
- %prep
- %setup -q
- %build
- # configure program
- %if "%{with_authonly}" == "yes"
- ./configure --authonly
- %else
- ./configure
- %endif
- # build program
- %{l_make} %{l_mflags}
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/bin \
- $RPM_BUILD_ROOT%{l_prefix}/sbin \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/maradns \
- $RPM_BUILD_ROOT%{l_prefix}/var/maradns \
- $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
- $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
- $RPM_BUILD_ROOT%{l_prefix}/man/man8
- # install program
- %{l_shtool} subst -e 's;RPM_BUILD_ROOT;PREFIX;g' build/install.sh
- export PREFIX=$RPM_BUILD_ROOT%{l_prefix}
- export LANGUAGE=en
- %{l_make} %{l_mflags} install
- # strip down installation
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/maradns/logger
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/mararc
- # install default configuration
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE mararc} $RPM_BUILD_ROOT%{l_prefix}/etc/maradns/
- sed -e 's;net;com;' -e 's;NET;COM;' \
- <$RPM_BUILD_ROOT%{l_prefix}/etc/maradns/db.example.net \
- >$RPM_BUILD_ROOT%{l_prefix}/etc/maradns/db.example.com
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.maradns} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/maradns/*' \
- '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/maradns'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} maradns status 2>/dev/null`
- [ ".$maradns_active" = .yes ] && %{l_rc} maradns restart
- exit 0
- %preun
- # before erase, stop service and remove log files
- [ $1 -eq 0 ] || exit 0
- %{l_rc} maradns stop 2>/dev/null
- rm -f $RPM_INSTALL_PREFIX/var/maradns/* >/dev/null 2>&1 || true
- exit 0
|