Contents of /branches/magellan-next/core/libutempter/libutempter-1.1.5-r1.smage2
Parent Directory | Revision Log
Revision 6461 -
(show annotations)
(download)
Wed Aug 25 21:28:51 2010 UTC (14 years, 1 month ago) by niro
File size: 1869 byte(s)
Wed Aug 25 21:28:51 2010 UTC (14 years, 1 month ago) by niro
File size: 1869 byte(s)
-fixed src_compile/install
1 | # $Id$ |
2 | |
3 | PNAME="libutempter" |
4 | PVER="1.1.5" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="sys-libs" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access." |
11 | HOMEPAGE="http://ftp.altlinux.org/pub/people/ldv/utempter/" |
12 | |
13 | DEPEND=">= virtual/glibc" |
14 | SDEPEND=">= app-arch/rpm2targz-9" |
15 | |
16 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
17 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
18 | |
19 | sminclude mbuild mtools |
20 | |
21 | SRC_URI=( |
22 | http://ftp.altlinux.org/pub/people/ldv/utempter/${SRCFILE} |
23 | mirror://${PNAME}/${SRCFILE} |
24 | ) |
25 | |
26 | UP2DATE="updatecmd ${HOMEPAGE}'?M=A' | lasttarball" |
27 | |
28 | src_compile() |
29 | { |
30 | cd ${SRCDIR} |
31 | |
32 | # 'utempter' will be added to libexecdir path automatically |
33 | mmake \ |
34 | RPM_OPT_FLAGS="${CFLAGS}" \ |
35 | libdir=/usr/$(mlibdir) \ |
36 | libexecdir=/usr/$(mlibdir) \ |
37 | || die |
38 | } |
39 | |
40 | src_install() |
41 | { |
42 | cd ${SRCDIR} |
43 | mmake \ |
44 | DESTDIR=${BINDIR} \ |
45 | RPM_OPT_FLAGS="${CFLAGS}" \ |
46 | libdir=/usr/$(mlibdir) \ |
47 | libexecdir=/usr/$(mlibdir) \ |
48 | || die |
49 | |
50 | # fix permissions |
51 | mchown root:utmp /usr/$(mlibdir)/utempter/utempter || die |
52 | mchmod 2755 /usr/$(mlibdir)/utempter/utempter || die |
53 | |
54 | # missing symlink |
55 | minstalldir /usr/sbin || die |
56 | mlink ../$(mlibdir)/utempter/utempter /usr/sbin/utempter || die |
57 | |
58 | minstalldocs COPYING README || die |
59 | } |
60 | |
61 | preinstall() |
62 | { |
63 | if [[ ! -z $(magequery -n utempter) ]] |
64 | then |
65 | echo -e ${COLRED} |
66 | echo -e "Error: sys-apps/utempter is installed!!" |
67 | echo -e "utempter is superseded by libutempter and must be removed from the system." |
68 | echo -e "Please uninstall sys-apps/mktemp first!" |
69 | echo -e ${COLDEFAULT} |
70 | die "sys-apps/utempter found!" |
71 | fi |
72 | |
73 | ${MLIBDIR}/mgroupadd -o "-g 406" utmp |
74 | } |
75 | |
76 | postinstall() |
77 | { |
78 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] |
79 | then |
80 | if [ -f /var/log/wtmp ] |
81 | then |
82 | chown root:utmp /var/log/wtmp |
83 | chmod 664 /var/log/wtmp |
84 | fi |
85 | |
86 | if [ -f /var/run/utmp ] |
87 | then |
88 | chown root:utmp /var/run/utmp |
89 | chmod 664 /var/run/utmp |
90 | fi |
91 | fi |
92 | } |