1 # 2 # spec file for package SUNWconsolekit 3 # 4 # includes module(s): ConsoleKit 5 # 6 # Copyright 2009 Sun Microsystems, Inc. 7 # This file and all modifications and additions to the pristine 8 # package are under the same license as the package itself. 9 # 10 %define owner halton 11 # 12 %include Solaris.inc 13 14 # Option to decide whether or not build library pam_ck_connector, 15 # which implements pam_sm_open_session(3PAM) and pam_sm_close_session(3PAM). 16 # By default, we don't build it. 17 # 18 # Note: To enable this pam module, you have to manually add 19 # an entry to /etc/pam.conf after installing SUNWconsolekit-pam, 20 # like this. 21 # "login session required pam_ck_connector.so debug" 22 # 23 %define build_pam_module 1 24 25 %use ck = ConsoleKit.spec 26 27 Name: SUNWconsolekit 28 Summary: Framework for tracking users, login sessions, and seats. 29 Version: %{ck.version} 30 SUNW_BaseDir: %{_basedir} 31 SUNW_Copyright: %{name}.copyright 32 BuildRoot: %{_tmppath}/%{name}-%{version}-build 33 Source: %{name}-manpages-0.1.tar.gz 34 Source1: consolekit.xml 35 36 %include default-depend.inc 37 38 Requires: SUNWglib2 39 Requires: SUNWdbus-libs 40 Requires: SUNWdbus-glib 41 BuildRequires: SUNWglib2-devel 42 BuildRequires: SUNWdbus-devel 43 BuildRequires: SUNWdbus-glib-devel 44 45 %package root 46 Summary: %{summary} - / filesystem 47 SUNW_BaseDir: / 48 %include default-depend.inc 49 50 %package devel 51 Summary: %{summary} - development files 52 SUNW_BaseDir: %{_basedir} 53 %include default-depend.inc 54 Requires: %name 55 56 %if %build_pam_module 57 %package pam 58 Summary: %{summary} - PAM module to register simple text logins. 59 SUNW_BaseDir: %{_basedir} 60 %include default-depend.inc 61 Requires: %name 62 %endif 63 64 %prep 65 rm -rf %name-%version 66 mkdir %name-%version 67 %ck.prep -d %name-%version 68 cd %{_builddir}/%name-%version 69 gzcat %SOURCE0 | tar xf - 70 71 %build 72 # FIXME: remove -D_POSIX_PTHREAD_SEMANTICS when not use CBE 1.6x 73 export CFLAGS="%optflags -D_POSIX_PTHREAD_SEMANTICS" 74 export RPM_OPT_FLAGS="$CFLAGS" 75 export LDFLAGS="%_ldflags" 76 77 %ck.build -d %name-%version 78 79 %install 80 rm -rf $RPM_BUILD_ROOT 81 %ck.install -d %name-%version 82 83 # Port the man8 file to SGML and add back the below "rm". 84 #rm -rf $RPM_BUILD_ROOT%{_mandir} 85 cd %{_builddir}/%name-%version/sun-manpages 86 make install DESTDIR=$RPM_BUILD_ROOT 87 88 # These programs are intended to be used if you want ConsoleKit to be 89 # like utmp/wtmp and log system start/restart/stop events. There are 90 # no plans to support using ConsoleKit like utmp/wtmp, so do not 91 # install these for now. 92 # 93 rm $RPM_BUILD_ROOT/%{_sbindir}/ck-log-system-start 94 rm $RPM_BUILD_ROOT/%{_sbindir}/ck-log-system-restart 95 rm $RPM_BUILD_ROOT/%{_sbindir}/ck-log-system-stop 96 97 install -d $RPM_BUILD_ROOT/var/svc/manifest/system 98 install --mode=0444 %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/system 99 100 %clean 101 rm -rf $RPM_BUILD_ROOT 102 103 %pre root 104 #!/bin/sh 105 # 106 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 107 # Use is subject to license terms. 108 # 109 110 # Presence of this temp file will tell postinstall script 111 # that the consolekit service is already installed, in which case 112 # the current service state will be preserved, be it enabled 113 # or disabled. 114 rm -f $PKG_INSTALL_ROOT/var/consolekit_installed.tmp > /dev/null 2>&1 115 116 if [ -f $PKG_INSTALL_ROOT/var/svc/manifest/system/consolekit.xml ]; then 117 touch $PKG_INSTALL_ROOT/var/consolekit_installed.tmp 118 fi 119 120 exit 0 121 122 %post root 123 #!/bin/sh 124 # 125 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 126 # Use is subject to license terms. 127 # 128 129 # Preinstall script will create this file if consolekit service was 130 # already installed, in which case we preserve current service state, 131 # be it enabled or disabled. 132 if [ -f $PKG_INSTALL_ROOT/var/consolekit_installed.tmp ]; then 133 rm -f $PKG_INSTALL_ROOT/var/consolekit_installed.tmp 134 else 135 # enable consolekit: 136 # - PKG_INSTALL_ROOT is / or empty when installing onto a live system 137 # and we can invoke svcadm directly; 138 # - otherwise it's upgrade, so we append to the upgrade script 139 if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then 140 if [ `/sbin/zonename` = global ]; then 141 /usr/sbin/svcadm enable -r svc:/system/consolekit:default 142 fi 143 else 144 cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF 145 if [ \`/sbin/zonename\` = global ]; then 146 /usr/sbin/svcadm enable -r svc:/system/consolekit:default 147 fi 148 EOF 149 fi 150 fi 151 152 exit 0 153 154 %files 155 %doc -d ConsoleKit-%{ck.version} README AUTHORS 156 %doc(bzip2) -d ConsoleKit-%{ck.version} COPYING NEWS 157 %dir %attr (0755, root, other) %{_datadir}/doc 158 %defattr (-, root, bin) 159 %{_bindir}/* 160 %{_sbindir}/* 161 %{_libdir}/lib*.so* 162 %{_libdir}/ConsoleKit 163 %{_libexecdir}/ck-collect-session-info 164 %{_libexecdir}/ck-get-x11-server-pid 165 %{_libexecdir}/ck-get-x11-display-device 166 %dir %attr (0755, root, sys) %{_datadir} 167 %{_datadir}/dbus-1 168 %dir %attr(0755, root, bin) %{_mandir} 169 %dir %attr(0755, root, bin) %{_mandir}/man1 170 %dir %attr(0755, root, bin) %{_mandir}/man1m 171 %{_mandir}/man1/* 172 %{_mandir}/man1m/* 173 174 %files root 175 %defattr (-, root, sys) 176 %{_sysconfdir}/ConsoleKit 177 %dir %attr (0755, root, bin) %{_sysconfdir}/dbus-1 178 %dir %attr (0755, root, bin) %{_sysconfdir}/dbus-1/system.d 179 %{_sysconfdir}/dbus-1/system.d/ConsoleKit.conf 180 %dir %attr (0755, root, sys) %dir %{_localstatedir} 181 # don't use %_localstatedir here, because this is an absolute path 182 # defined by another package, so it has to be /var/svc even if this 183 # package's %_localstatedir is redefined 184 /var/svc/* 185 %dir %attr (0755, root, sys) %{_localstatedir}/log 186 %dir %attr (0755, root, root) %{_localstatedir}/log/ConsoleKit 187 188 %files devel 189 %defattr (-, root, bin) 190 %{_includedir}/* 191 %dir %attr (0755, root, other) %{_libdir}/pkgconfig 192 %{_libdir}/pkgconfig/* 193 194 %if %build_pam_module 195 %files pam 196 %defattr (-, root, bin) 197 %{_libdir}/security/pam*.so* 198 %dir %attr (0755, root, sys) %{_datadir} 199 %{_mandir}/man8/* 200 %endif 201 202 %changelog 203 * Fri Oct 23 2009 - brian.cameron@sun.com 204 - Add manpages. 205 * Tue Aug 18 2009 - halton.huo@sun.com 206 - Enable pam module. 207 * Thu Jul 30 2009 - halton.huo@sun.com 208 - Add %pre and %post for -root pkg. 209 * Mon Jul 27 2009 - halton.huo@sun.com 210 - Move from SFE and spilit base part to ConsoleKit.spec 211 * Thu Jul 23 2009 - halton.huo@sun.com 212 - Bump to 0.3.1 213 - Remove upstreamed patch: emptystruct.diff, pam.diff, solaris-getpwnamr.diff 214 and reorder rest 215 - Add patch dev-console.diff to change owner of /dev/console for console login 216 * Tue Jun 23 2009 - halton.huo@sun.com 217 - Add copyright 218 * Wed Apr 08 2009 - halton.huo@sun.com 219 - Add patch8: solaris-getpwnamr.diff to fix bug #22361 220 * Wed Apr 08 2009 - halton.huo@sun.com 221 - Add patch5: add-sunray-type.diff to add Sunray for display-typs.conf.in 222 - Add patch6: dynamic-tty.diff to add --tty for ck-dynaminc 223 - Add patch7: solaris-vtdaemon.diff to check vtdaemon service code for Solaris 224 * Thu Mar 26 2009 - halton.huo@sun.com 225 - Add all files under etc/ConsoleKit/ to %files root 226 * Sat Feb 07 2009 - brian.cameron@sun.com 227 - Package should not install anything to /var/run. 228 * Tue Dec 30 2008 - halton.huo@sun.com 229 - Add patch ck-dynamic.diff to fix bug #19333 230 * Tue Oct 21 2008 - halton.huo@sun.com 231 - Add standard patch comment 232 * Thu Aug 07 2008 - brian.cameron@sun.com 233 - Bump to 0.3.0. 234 * Tue Jun 24 2008 - simon.zheng@sun.com 235 - Add patch 05-getcurrentsession.diff for freedesktop bug #15866. 236 * Tue Mar 11 2008 - brian.cameron@sun.com 237 - Minor cleanup 238 * Tue Mar 04 2008 - simon.zheng@sun.com 239 - Add patch 04-ck-history.diff to fix crash. 240 * Sat Mar 01 2008 - simon.zheng@sun.com 241 - Add patch 03-pam.diff to build pam module library 242 pam-ck-connector that registers text login session into 243 ConsoleKit. And this library is packed as a separate 244 package called SFEconsolekit-pam. 245 * Mon Feb 25 2008 - brian.cameron@sun.com 246 - Bump release to 0.2.10. Worked with the maintainer to get seven 247 recent patches upstream. 248 * Mon Feb 25 2008 - simon.zheng@sun.com 249 - Rework ConsoleKit-06-fixvt.diff for better macro definition. 250 * Fri Feb 22 2008 - brian.cameron@sun.com 251 - Add the patch ConsoleKit-05-devname.diff that Simon wrote, patch 252 ConsoleKit-06-fixvt.diff so that patch 4 builds properly when you 253 do not have VT installed, patch ConsoleKit-07-fixactiveconsole.diff 254 so that Active device is set to "/dev/console" when not using VT, 255 ConsoleKit-08-fixseat.diff to correct a crash due to a NULL string 256 in a printf, and ConsoleKit-09-novt.diff to fix ConsoleKit so that 257 it sets x11-display-device to "/dev/console" when not using 258 VT. 259 * Tue Feb 19 2008 - simon.zheng@sun.com 260 - Add patch ConsoleKit-04-vt.diff. Use sysnchronous event notification 261 in STREAMS to monitor VT activation. 262 * Fri Feb 15 2008 - brian.cameron@sun.com 263 - Rework ConsoleKit-03-paths.diff so it makes better use of #ifdefs. 264 * Fri Feb 15 2008 - simon.zheng@sun.com 265 - Bump to 0.2.9. Add ConsoleKit-03-noheaderpaths.diff because there's not 266 header paths.h on Solaris. 267 * Thu Feb 07 2008 - Brian.Cameron (at] sun.com 268 - Add /var/log/ConsoleKit/history file to packaging. 269 * Thu Jan 31 2008 - Brian.Cameron (at] sun.com 270 - Bump to 0.2.7. Remove two upstream patches added on January 25, 271 2007. 272 * Fri Jan 25 2008 - Brian.Cameron (at] sun.com 273 - Bump to 0.2.6. Rework patches. Add patch ConsoleKit-02-RBAC.diff 274 to make ConsoleKit use RBAC instead of PolicyKit on Solaris. 275 Patch ConsoleKit-03-fixbugs.diff fixes some bugs I found. 276 * Tue Sep 18 2007 - Brian.Cameron (at] sun.com 277 - Bump to 0.2.3. Remove upstream ConsoleKit-01-head.diff 278 patch and add ConsoleKit-02-fixsolaris.diff to fix some 279 issues building ConsoleKit when VT is not present. 280 * Mon Aug 16 2007 - Brian.Cameron (at] sun.com 281 - Created. 282