pam/pam.spec

Sun, 05 Aug 2012 22:52:01 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 05 Aug 2012 22:52:01 +0200
changeset 480
332ec562ab2e
child 481
7b6013bffe8c
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@480 1 ##
michael@480 2 ## pam.spec -- OpenPKG RPM Package Specification
michael@480 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@480 4 ##
michael@480 5 ## Permission to use, copy, modify, and distribute this software for
michael@480 6 ## any purpose with or without fee is hereby granted, provided that
michael@480 7 ## the above copyright notice and this permission notice appear in all
michael@480 8 ## copies.
michael@480 9 ##
michael@480 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@480 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@480 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@480 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@480 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@480 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@480 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@480 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@480 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@480 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@480 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@480 21 ## SUCH DAMAGE.
michael@480 22 ##
michael@480 23
michael@480 24 # package information
michael@480 25 Name: pam
michael@480 26 Summary: Information Resource for PAM
michael@480 27 URL: -
michael@480 28 Vendor: The OpenPKG Project
michael@480 29 Packager: OpenPKG Foundation e.V.
michael@480 30 Distribution: OpenPKG Community
michael@480 31 Class: BASE
michael@480 32 Group: Meta
michael@480 33 License: PD
michael@480 34 Version: 0
michael@480 35 Release: 20110219
michael@480 36
michael@480 37 # list of sources
michael@480 38 Source0: pamtool
michael@480 39 Source1: rc.pam
michael@480 40
michael@480 41 # build information
michael@480 42 BuildPreReq: OpenPKG, openpkg >= 20100101
michael@480 43 PreReq: OpenPKG, openpkg >= 20100101
michael@480 44 Provides: PAM
michael@480 45
michael@480 46 %description
michael@480 47 This is the information resource package for PAM.
michael@480 48
michael@480 49 %track
michael@480 50
michael@480 51 %prep
michael@480 52
michael@480 53 %build
michael@480 54
michael@480 55 %install
michael@480 56
michael@480 57 pam_cfgloc=""
michael@480 58 pam_modpfx=""
michael@480 59 pam_incdir=""
michael@480 60 pam_libdir=""
michael@480 61
michael@480 62 # search for configuration location
michael@480 63 for cfgloc in \
michael@480 64 /etc/pam.d \
michael@480 65 /etc/pam.conf \
michael@480 66 ; do
michael@480 67 if [ -f $cfgloc -o -d $cfgloc ]; then
michael@480 68 pam_cfgloc="$cfgloc"
michael@480 69 break
michael@480 70 fi
michael@480 71 done
michael@480 72
michael@480 73 # search for module prefix
michael@480 74 if [ -d $pam_cfgloc ]; then
michael@480 75 mod=`cat $pam_cfgloc/* 2>/dev/null | grep -i '^#*[ ]*other' | head -1 | awk '{ print $3; }'`
michael@480 76 elif [ -f $pam_cfgloc ]; then
michael@480 77 mod=`cat $pam_cfgloc 2>/dev/null | grep -i '^#*[ ]*other' | head -1 | awk '{ print $4; }'`
michael@480 78 else
michael@480 79 mod=""
michael@480 80 fi
michael@480 81 case $mod in
michael@480 82 pam_* ) pam_modpfx="" ;;
michael@480 83 /*/pam_* ) pam_modpfx=`echo $mod | sed 's;^\(/.*/\)pam_[^/]*$;\1;'` ;;
michael@480 84 esac
michael@480 85
michael@480 86 # search for include directory
michael@480 87 for incdir in \
michael@480 88 /usr/include \
michael@480 89 /usr/local/include \
michael@480 90 /opt/include \
michael@480 91 ; do
michael@480 92 if [ -f "$incdir/security/pam_appl.h" ]; then
michael@480 93 pam_incdir="$incdir"
michael@480 94 break
michael@480 95 fi
michael@480 96 done
michael@480 97
michael@480 98 # search for library directory
michael@480 99 for libdir in \
michael@480 100 /lib \
michael@480 101 /usr/lib \
michael@480 102 /usr/local/lib \
michael@480 103 /opt/lib \
michael@480 104 ; do
michael@480 105 for ext in a so sl so.0; do
michael@480 106 if [ -f "$libdir/libpam.$ext" ]; then
michael@480 107 pam_libdir="$libdir"
michael@480 108 break
michael@480 109 fi
michael@480 110 done
michael@480 111 if [ ".$pam_libdir" != . ]; then
michael@480 112 break
michael@480 113 fi
michael@480 114 done
michael@480 115
michael@480 116 # make sure everything was found
michael@480 117 if [ ".$pam_cfgloc" = . ] ||\
michael@480 118 [ ".$pam_incdir" = . ] ||\
michael@480 119 [ ".$pam_libdir" = . ]; then
michael@480 120 set +x
michael@480 121 ( echo "************************************************************"
michael@480 122 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
michael@480 123 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
michael@480 124 echo "**"
michael@480 125 echo "** We found out:"
michael@480 126 echo "** PAM Config Location: \"${pam_cfgloc}\""
michael@480 127 echo "** PAM Module Prefix: \"${pam_modpfx}\""
michael@480 128 echo "** PAM Include Directory: \"${pam_incdir}\""
michael@480 129 echo "** PAM Library Directory: \"${pam_libdir}\""
michael@480 130 echo "**"
michael@480 131 echo "** Unfortunately, some information is missing here."
michael@480 132 echo "**"
michael@480 133 echo "** Be sure to have all system PAM components installed"
michael@480 134 echo "** in standard locations before building this package!"
michael@480 135 echo "**"
michael@480 136 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
michael@480 137 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
michael@480 138 echo "************************************************************"
michael@480 139 ) | %{l_rpmtool} msg -b -t error
michael@480 140 exit 1
michael@480 141 fi
michael@480 142
michael@480 143 # install PAM tool
michael@480 144 %{l_shtool} mkdir -f -p -m 755 \
michael@480 145 $RPM_BUILD_ROOT%{l_prefix}/sbin
michael@480 146 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@480 147 -e 's;@l_platform@;%{l_platform -t};g' \
michael@480 148 %{SOURCE pamtool} $RPM_BUILD_ROOT%{l_prefix}/sbin/
michael@480 149
michael@480 150 # install rc file
michael@480 151 %{l_shtool} mkdir -f -p -m 755 \
michael@480 152 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@480 153 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@480 154 -e "s;@pam_cfgloc@;${pam_cfgloc};g" \
michael@480 155 -e "s;@pam_modpfx@;${pam_modpfx};g" \
michael@480 156 -e "s;@pam_incdir@;${pam_incdir};g" \
michael@480 157 -e "s;@pam_libdir@;${pam_libdir};g" \
michael@480 158 %{SOURCE rc.pam} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@480 159
michael@480 160 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@480 161
michael@480 162 %files -f files
michael@480 163
michael@480 164 %clean
michael@480 165

mercurial