Annotation of /trunk/extras/libutempter/libutempter-1.1.6-r2.smage2
Parent Directory | Revision Log
Revision 23021 -
(hide annotations)
(download)
Tue Oct 28 12:00:08 2014 UTC (9 years, 11 months ago) by niro
File size: 1927 byte(s)
Tue Oct 28 12:00:08 2014 UTC (9 years, 11 months ago) by niro
File size: 1927 byte(s)
-mass rebuild of older packages
1 | niro | 23021 | # $Id$ |
2 | |||
3 | PNAME="libutempter" | ||
4 | PVER="1.1.6" | ||
5 | PBUILD="r2" | ||
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 | SPECIAL_FUNCTIONS="pkg_setup" | ||
19 | |||
20 | sminclude mbuild mtools | ||
21 | msetfeature "!check" | ||
22 | |||
23 | SRC_URI=( | ||
24 | http://ftp.altlinux.org/pub/people/ldv/utempter/${SRCFILE} | ||
25 | mirror://${PNAME}/${SRCFILE} | ||
26 | ) | ||
27 | |||
28 | UP2DATE="updatecmd ${HOMEPAGE}'?M=A' | lasttarball" | ||
29 | |||
30 | pkg_setup() | ||
31 | { | ||
32 | mgroupadd -o "-g 406" utmp | ||
33 | } | ||
34 | |||
35 | src_compile() | ||
36 | { | ||
37 | cd ${SRCDIR} | ||
38 | |||
39 | # 'utempter' will be added to libexecdir path automatically | ||
40 | mmake \ | ||
41 | RPM_OPT_FLAGS="${CFLAGS}" \ | ||
42 | libdir=/usr/$(mlibdir) \ | ||
43 | libexecdir=/usr/$(mlibdir) \ | ||
44 | || die | ||
45 | } | ||
46 | |||
47 | src_install() | ||
48 | { | ||
49 | cd ${SRCDIR} | ||
50 | mmake \ | ||
51 | DESTDIR=${BINDIR} \ | ||
52 | RPM_OPT_FLAGS="${CFLAGS}" \ | ||
53 | libdir=/usr/$(mlibdir) \ | ||
54 | libexecdir=/usr/$(mlibdir) \ | ||
55 | install \ | ||
56 | || die | ||
57 | |||
58 | # fix permissions | ||
59 | mchown root:utmp /usr/$(mlibdir)/utempter/utempter || die | ||
60 | mchmod 2755 /usr/$(mlibdir)/utempter/utempter || die | ||
61 | |||
62 | # missing symlink | ||
63 | minstalldir /usr/sbin || die | ||
64 | mlink ../$(mlibdir)/utempter/utempter /usr/sbin/utempter || die | ||
65 | |||
66 | minstalldocs COPYING README || die | ||
67 | } | ||
68 | |||
69 | preinstall() | ||
70 | { | ||
71 | if [[ ! -z $(magequery -n utempter) ]] | ||
72 | then | ||
73 | echo -e ${COLRED} | ||
74 | echo -e "Error: sys-apps/utempter is installed!!" | ||
75 | echo -e "utempter is superseded by libutempter and must be removed from the system." | ||
76 | echo -e "Please uninstall sys-apps/mktemp first!" | ||
77 | echo -e ${COLDEFAULT} | ||
78 | die "sys-apps/utempter found!" | ||
79 | fi | ||
80 | |||
81 | pkg_setup | ||
82 | } | ||
83 | |||
84 | postinstall() | ||
85 | { | ||
86 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] | ||
87 | then | ||
88 | if [ -f /var/log/wtmp ] | ||
89 | then | ||
90 | chown root:utmp /var/log/wtmp | ||
91 | chmod 664 /var/log/wtmp | ||
92 | fi | ||
93 | |||
94 | if [ -f /var/run/utmp ] | ||
95 | then | ||
96 | chown root:utmp /var/run/utmp | ||
97 | chmod 664 /var/run/utmp | ||
98 | fi | ||
99 | fi | ||
100 | } |