Mon, 17 Sep 2012 19:10:10 +0200
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 ## pam.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 information
25 Name: pam
26 Summary: Information Resource for PAM
27 URL: -
28 Vendor: The OpenPKG Project
29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community
31 Class: BASE
32 Group: Meta
33 License: PD
34 Version: 0
35 Release: 20120800
37 # list of sources
38 Source0: pamtool
39 Source1: rc.pam
41 # build information
42 BuildPreReq: OpenPKG, openpkg >= 20100101
43 PreReq: OpenPKG, openpkg >= 20100101
44 Provides: PAM
46 %description
47 This is the information resource package for PAM.
49 %track
51 %prep
53 %build
55 %install
57 pam_cfgloc=""
58 pam_modpfx=""
59 pam_incdir=""
60 pam_libdir=""
62 # search for configuration location
63 for cfgloc in \
64 /etc/pam.d/other \
65 /etc/pam.d \
66 /etc/pam.conf \
67 ; do
68 if [ -f $cfgloc -o -d $cfgloc ]; then
69 pam_cfgloc="$cfgloc"
70 break
71 fi
72 done
74 # search for module prefix
75 if [ -d $pam_cfgloc ]; then
76 mod=`cat $pam_cfgloc/* 2>/dev/null | grep -i '^#*[ ]*other' | head -1 | awk '{ print $3; }'`
77 elif [ -f $pam_cfgloc ]; then
78 mod=`cat $pam_cfgloc 2>/dev/null | grep -i '^#*[ ]*other' | head -1 | awk '{ print $4; }'`
79 if [ ".$mod" = . ]; then \
80 mod=`cat $pam_cfgloc 2>/dev/null | grep -i '^#*[ ]*auth' | head -1 | awk '{ print $3; }'`
81 fi
82 else
83 mod=""
84 fi
85 case $mod in
86 pam_* ) pam_modpfx="" ;;
87 /*/pam_* ) pam_modpfx=`echo $mod | sed 's;^\(/.*/\)pam_[^/]*$;\1;'` ;;
88 esac
90 # search for include directory
91 for incdir in \
92 /usr/include \
93 /usr/local/include \
94 /opt/include \
95 ; do
96 if [ -f "$incdir/security/pam_appl.h" ]; then
97 pam_incdir="$incdir"
98 break
99 fi
100 done
102 # search for library directory
103 for libdir in \
104 /lib \
105 /lib64 \
106 /usr/lib \
107 /usr/lib64 \
108 /usr/local/lib \
109 /usr/local/lib64 \
110 /opt/lib \
111 /opt/lib64 \
112 ; do
113 for ext in a so sl so.0; do
114 if [ -f "$libdir/libpam.$ext" ]; then
115 pam_libdir="$libdir"
116 break
117 fi
118 done
119 if [ ".$pam_libdir" != . ]; then
120 break
121 fi
122 done
124 # make sure everything was found
125 if [ ".$pam_cfgloc" = . ] ||\
126 [ ".$pam_incdir" = . ] ||\
127 [ ".$pam_libdir" = . ]; then
128 set +x
129 ( echo "************************************************************"
130 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
131 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
132 echo "**"
133 echo "** We found out:"
134 echo "** PAM Config Location: \"${pam_cfgloc}\""
135 echo "** PAM Module Prefix: \"${pam_modpfx}\""
136 echo "** PAM Include Directory: \"${pam_incdir}\""
137 echo "** PAM Library Directory: \"${pam_libdir}\""
138 echo "**"
139 echo "** Unfortunately, some information is missing here."
140 echo "**"
141 echo "** Be sure to have all system PAM components installed"
142 echo "** in standard locations before building this package!"
143 echo "**"
144 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
145 echo "** ERROR: SOME PAM INFORMATION COULD NOT BE DETERMINED!!"
146 echo "************************************************************"
147 ) | %{l_rpmtool} msg -b -t error
148 exit 1
149 fi
151 # install PAM tool
152 %{l_shtool} mkdir -f -p -m 755 \
153 $RPM_BUILD_ROOT%{l_prefix}/sbin
154 %{l_shtool} install -c -m 755 %{l_value -s -a} \
155 -e 's;@l_platform@;%{l_platform -t};g' \
156 %{SOURCE pamtool} $RPM_BUILD_ROOT%{l_prefix}/sbin/
158 # install rc file
159 %{l_shtool} mkdir -f -p -m 755 \
160 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
161 %{l_shtool} install -c -m 755 %{l_value -s -a} \
162 -e "s;@pam_cfgloc@;${pam_cfgloc};g" \
163 -e "s;@pam_modpfx@;${pam_modpfx};g" \
164 -e "s;@pam_incdir@;${pam_incdir};g" \
165 -e "s;@pam_libdir@;${pam_libdir};g" \
166 %{SOURCE rc.pam} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
168 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
170 %files -f files
172 %clean