Magellan Linux

Contents of /branches/magellan-next/core/libutempter/libutempter-1.1.5-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7755 - (show annotations) (download)
Tue May 31 17:17:37 2011 UTC (12 years, 11 months ago) by niro
File size: 1881 byte(s)
auto added: ver bump to 1.1.5-r2
1 # $Id$
2
3 PNAME="libutempter"
4 PVER="1.1.5"
5 PBUILD="r2"
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 install \
49 || die
50
51 # fix permissions
52 mchown root:utmp /usr/$(mlibdir)/utempter/utempter || die
53 mchmod 2755 /usr/$(mlibdir)/utempter/utempter || die
54
55 # missing symlink
56 minstalldir /usr/sbin || die
57 mlink ../$(mlibdir)/utempter/utempter /usr/sbin/utempter || die
58
59 minstalldocs COPYING README || die
60 }
61
62 preinstall()
63 {
64 if [[ ! -z $(magequery -n utempter) ]]
65 then
66 echo -e ${COLRED}
67 echo -e "Error: sys-apps/utempter is installed!!"
68 echo -e "utempter is superseded by libutempter and must be removed from the system."
69 echo -e "Please uninstall sys-apps/mktemp first!"
70 echo -e ${COLDEFAULT}
71 die "sys-apps/utempter found!"
72 fi
73
74 ${MLIBDIR}/mgroupadd -o "-g 406" utmp
75 }
76
77 postinstall()
78 {
79 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
80 then
81 if [ -f /var/log/wtmp ]
82 then
83 chown root:utmp /var/log/wtmp
84 chmod 664 /var/log/wtmp
85 fi
86
87 if [ -f /var/run/utmp ]
88 then
89 chown root:utmp /var/run/utmp
90 chmod 664 /var/run/utmp
91 fi
92 fi
93 }