Annotation of /branches/R11-stable/extras/libutempter/libutempter-1.1.6-r1.smage2
Parent Directory | Revision Log
Revision 12872 -
(hide annotations)
(download)
Wed Jul 4 14:40:35 2012 UTC (12 years, 2 months ago) by niro
Original Path: trunk/core/libutempter/libutempter-1.1.6-r1.smage2
File size: 1879 byte(s)
Wed Jul 4 14:40:35 2012 UTC (12 years, 2 months ago) by niro
Original Path: trunk/core/libutempter/libutempter-1.1.6-r1.smage2
File size: 1879 byte(s)
auto added: ver bump to 1.1.6-r1
1 | niro | 12872 | # $Id$ |
2 | |||
3 | PNAME="libutempter" | ||
4 | PVER="1.1.6" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCAT="sys-libs" | ||
8 | |||
9 | DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access." | ||
10 | HOMEPAGE="http://ftp.altlinux.org/pub/people/ldv/utempter/" | ||
11 | |||
12 | DEPEND=">= virtual/glibc" | ||
13 | SDEPEND=">= app-arch/rpm2targz-9" | ||
14 | |||
15 | SRCFILE="${PNAME}-${PVER}.tar.bz2" | ||
16 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
17 | |||
18 | sminclude mbuild mtools | ||
19 | msetfeature "!check" | ||
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 | } |