d67e56ac0cfe8da9d222b48e9f3f3f7496779553
[openpandora.oe.git] / recipes / slim / slim_1.3.1.bb
1 DESCRIPTION="Simple Login Manager"
2 HOMEPAGE="http://slim.berlios.de"
3 LICENSE = "GPL"
4
5 PR = "r4"
6
7 inherit update-rc.d
8
9 DEPEND="virtual/x11 libxmu libpng libjpeg libpam freetype sessreg"
10
11 RDEPEND="${DEPEND} perl libpam-meta xauth"
12     
13 S = "${WORKDIR}/${PN}-${PV}/"
14
15 SRC_URI=" \
16   http://download.berlios.de/${PN}/${P}.tar.gz \
17   file://fix-manpage.patch;patch=1 \
18   file://ftbfs_gcc_4.4.patch;patch=1 \
19   file://Makefile.patch;patch=1 \
20   file://xauth_secret_support.patch;patch=1 \
21   file://delay.patch;patch=1 \  
22   file://pam-unix2.patch;patch=1 \    
23   file://rc.slim \
24   file://slim-dynwm \
25   file://update_slim_wmlist \
26   file://Makefile.oe \  
27   file://slim.pamd \
28 "
29
30 EXTRA_OEMAKE += " \
31   USE_PAM=1 \
32   PREFIX=${prefix} \
33   CFGDIR=${sysconfdir} \
34   MANDIR=${mandir} \
35   DESTDIR=${D} \
36   CFLAGS+=-I${STAGING_INCDIR}/freetype2 \
37   CXXFLAGS+=-I${STAGING_INCDIR}/freetype2 \
38   LDFLAGS+=-lXft \
39   LDFLAGS+=-lX11 \
40   LDFLAGS+=-lfreetype \
41   LDFLAGS+=-lXrender \
42   LDFLAGS+=-lfontconfig \
43   LDFLAGS+=-lpng12 \
44   LDFLAGS+=-lz \
45   LDFLAGS+=-lm \
46   LDFLAGS+=-lcrypt \
47   LDFLAGS+=-lXmu \
48   LDFLAGS+=-lpng \
49   LDFLAGS+=-ljpeg \
50   LDFLAGS+=-lrt \
51   LDFLAGS+=-lpam \
52 "
53
54 do_compile_prepend() {
55   cp -pP ${WORKDIR}/Makefile.oe ${S}/Makefile
56 }
57
58 do_install() {
59   oe_runmake install 
60   install -d ${D}${bindir}
61   install -m 0755 ${WORKDIR}/slim-dynwm ${D}${bindir}/
62   install -m 0755 ${WORKDIR}/update_slim_wmlist ${D}${bindir}/
63   install -d ${D}${sysconfdir}/pam.d/  
64   install -m 0644 ${WORKDIR}/slim.pamd ${D}${sysconfdir}/pam.d/slim
65   install -d ${D}${sysconfdir}/init.d/
66   install -m 0755 ${WORKDIR}/rc.slim ${D}${sysconfdir}/init.d/slim-init
67
68   echo 'sessionstart_cmd    /usr/bin/sessreg -a -l $DISPLAY %user' >> ${D}${sysconfdir}/slim.conf
69   echo 'sessionstop_cmd     /usr/bin/sessreg -d -l $DISPLAY %user' >> ${D}${sysconfdir}/slim.conf
70 }
71
72 INITSCRIPT_NAME = "slim-init"
73 INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
74
75 pkg_postinst_${PN} () {
76 # Register SLiM as default DM
77 mkdir -p ${sysconfdir}/X11/
78 echo "${bindir}/slim" > ${sysconfdir}/X11/default-display-manager
79 }
80
81 pkg_postrm_${PN} () {
82 sed -i /slim/d ${sysconfdir}/X11/default-display-manager || true
83 }