%global alphatag -alpha1 # Package Review bug is https://bugzilla.redhat.com/542580 Name: statusnet Version: 1.1.0 License: AGPLv3 Release: 0.1%{?dist} URL: http://status.net Source0: http://status.net/statusnet-%{version}%{?alphatag}.tar.gz Source1: statusnet-httpd-conf Source2: statusnet-config-sample.php Group: Applications/Internet Summary: Open Source microblogging platform BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Requires: httpd Requires: mysql-server >= 5.0.0 Requires: php >= 5.2.6 Requires: php-curl Requires: php-gd Requires: php-gettext Requires: php-mysql Requires: php-mbstring Requires: php-pear-Mail-Mime Requires: php-pear-DB-DataObject Requires: php-tidy Requires: php-bcmath Requires: php-xml Requires: php-process BuildRequires: php-pear BuildRequires: httpd-devel Requires(pre): shadow-utils #php-xmlrpc #php-pecl-apc # Will also provide laconica (old name) Provides: php-laconica = %{version}-%{release} Obsoletes: php-laconica < 0.5.0-6 %global apache_serverroot %(/usr/sbin/apxs -q DATADIR) %global apache_sysconfdir %(/usr/sbin/apxs -q SYSCONFDIR) %global wwwpath %{_datadir}/%{name} %global confpath %{_sysconfdir}/%{name} %description StatusNet is a Free and Open Source microblogging platform. It helps people in a community, company or group to exchange short (140 character) messages over the Web. Users can choose which people to "follow" and receive only their friends' or colleagues' status messages. For using memcached you need also packages memcached and php-pecl-memcache. %prep %setup -q -n %{name}-%{version}%{?alphatag} %build # Empty build %install rm -rf %buildroot mkdir -p %{buildroot}%{wwwpath} cp -p -a * %{buildroot}%{wwwpath} # # Use sysconf config instead of in directory config install -D -p -m 644 %{SOURCE2} \ %{buildroot}/%{_sysconfdir}/%{name}/%{name}.php # Remove dangerous or unwanted files rm -rf %{buildroot}%{wwwpath}/{tests,COPYING,EVENTS.txt,.git*} mkdir -p %{buildroot}%{_datadir}/%{name} # Install Apache configuration install -D -p -m 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/httpd/conf.d/statusnet.conf mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/avatar mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/background mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/file pushd %{buildroot}/%{_datadir}/%{name} rm -rf avatar background file ln -s ../../..%{_localstatedir}/lib/%{name}/avatar/ . ln -s ../../..%{_localstatedir}/lib/%{name}/background/ . ln -s ../../..%{_localstatedir}/lib/%{name}/file/ . popd # Clean out the shebangs for f in `find %{buildroot}%{_datadir}/%{name} -name "*.php"`; do sed -i -e '/^#!/d' $f done # Fix anything executable that does not have a shebang for file in `find %{buildroot}/%{_datadir}/%{name} -type f -perm /a+x`; do [ -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 644 $file done %clean rm -rf %buildroot %check /bin/true %pre getent group statusnet >/dev/null || groupadd -r statusnet getent passwd statusnet >/dev/null || \ useradd -r -g statusnet -d %{_localstatedir}/lib/%{name} \ -s /sbin/nologin \ -c "Separate account for running status.net" \ statusnet exit 0 %files %defattr(-,root,root) # FIXME should we include tests at all? Shouldn't we just run them? %doc COPYING README EVENTS.txt doc-src/* db tests %attr(-,apache,apache) %{wwwpath} %dir %{_localstatedir}/lib/%{name} %attr(-,apache,apache) %dir %{_localstatedir}/lib/%{name}/avatar %attr(-,apache,apache) %dir %{_localstatedir}/lib/%{name}/background %attr(-,apache,apache) %dir %{_localstatedir}/lib/%{name}/file %config(noreplace) %{_sysconfdir}/httpd/conf.d/statusnet.conf %dir %{_sysconfdir}/%{name}/ %config(noreplace) %attr(660,root,apache) %{_sysconfdir}/%{name}/%{name}.php %changelog * Thu Jan 05 2012 'Matej Cepl ' - 1.0.1-0.4 - Renew the effort to package. * Thu Aug 18 2011 Matěj Cepl - 1.0.0-0.3.beta2 - php-eaccelerator as Requires? Just say NO! * Tue Aug 16 2011 Matěj Cepl - 1.0.0-0.1.beta2 - New upstream beta version. - Coupld of integration nits fixed. * Tue Jul 26 2011 Matěj Cepl - 0.9.7fix1-0 - First attempt to restart the packaging process. * Tue Feb 10 2010 Steve 'Ashcrow' Milner - 0.8.3-2 - Removed unwanted files from the webroot - Added more install requirements - Moved configuration file into sysconfdir - Config is only rw by root and apache user - Moved all write required folders into localstatedir * Tue Feb 10 2010 Steve 'Ashcrow' Milner - 0.8.3-1 - Updated for upstream release. * Tue Jan 5 2010 Jeroen van Meeuwen - 0.8.2-2 - Suggest some packaging semantics * Mon Nov 30 2009 Rakesh Pandit - 0.8.2-1 - Updated to 0.8.2, polished description, fixed sanity - removed redundant avatar folder * Wed Apr 03 2009 Zach Copley - 0.7.3 - Changed version number to 0.7.3. * Fri Mar 13 2009 Ken Sedgwick - 0.7.2.1-1 - Factored statusnet version to the first line of the file. * Wed Mar 03 2009 Zach Copley - 0.7.2 - Changed version number to 0.7.2. * Sat Feb 28 2009 Ken Sedgwick - 0.7.1-1 - Modified RPM for Fedora. * Thu Feb 13 2009 tuukka.pasanen@ilmi.fi - packaged statusnet version 0.7.1 * Wed Feb 04 2009 tuukka.pasanen@ilmi.fi - packaged statusnet version 0.7.0 using the buildservice spec file wizard