PageRenderTime 151ms CodeModel.GetById 30ms app.highlight 49ms RepoModel.GetById 18ms app.codeStats 1ms

/neatx/extras/rpm/neatx.spec

http://neatx.googlecode.com/
Unknown | 107 lines | 90 code | 17 blank | 0 comment | 0 complexity | 779d3d335c81b1cc57d7705c5f9d18ac MD5 | raw file
  1# .spec file to package NeatX in RPM.
  2# Author: Alexander Todorov <alexx.todorov@no_spam.gmail.com>
  3
  4%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  5%global nx_homedir /home/.nxhome
  6
  7Summary: An Open Source NX server
  8Name: neatx
  9Version: 0.1
 10Release: 1%{?dist}
 11Source: %{name}-%{version}.tar.gz
 12License: GPLv2
 13Group: User Interface/X
 14URL: http://code.google.com/p/neatx/
 15
 16BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 17BuildArch: %{_arch}
 18
 19BuildRequires: autoconf
 20BuildRequires: automake
 21BuildRequires: gcc
 22BuildRequires: make
 23BuildRequires: python-devel
 24BuildRequires: python-docutils
 25
 26Requires: nc
 27Requires: nx
 28Requires: openssh
 29Requires: pexpect
 30Requires: pygobject2 >= 2.14
 31Requires: pygtk2 >= 2.10
 32Requires: python >= 2.4
 33Requires: python-simplejson
 34Requires: xauth
 35Requires: xorg-x11-fonts-misc
 36Requires: xorg-x11-xkb-utils
 37Requires: xrdb
 38Requires: xterm
 39Requires(pre): shadow-utils
 40Requires(post): %__install
 41
 42%description
 43Neatx is an Open Source NX server, similar to the commercial NX server from 
 44NoMachine.
 45
 46%prep
 47%setup -cq
 48
 49%build
 50# fixup paths
 51sed -ri 's@^(XSESSION\s+=).*@\1 "/etc/X11/xinit/Xsession"@' lib/constants.py
 52sed -ri 's@^(NETCAT\s+=).*@\1 "/usr/bin/nc"@' lib/constants.py
 53sed -ri 's@^(#xsession-path\s+=).*@\1 /etc/X11/xinit/Xsession@' doc/neatx.conf.example
 54sed -ri 's@^(#netcat-path\s+=).*@\1 /usr/bin/nc@' doc/neatx.conf.example
 55./autogen.sh
 56%configure
 57make
 58
 59%install
 60rm -rf %{buildroot}
 61make DESTDIR=%{buildroot} install
 62# provide a meaningfull config file
 63%__install -D -m 644 %{buildroot}/%_docdir/%{name}/neatx.conf.example %{buildroot}/etc/neatx.conf
 64%__install -D -m 755 extras/rpm/neatx.initscript %{buildroot}/etc/init.d/neatx
 65
 66%clean
 67rm -rf %{buildroot}
 68
 69%pre
 70# create the nx user account
 71getent group nx >/dev/null || groupadd -r nx
 72getent passwd nx >/dev/null || \
 73       useradd -r -g nx -m -d %nx_homedir -s %_libdir/%{name}/nxserver-login-wrapper \
 74      -c "System account for the %{name} package" nx
 75chown -R nx: %nx_homedir
 76exit 0
 77
 78%post
 79if [ $1 -eq 1 ]; then
 80    # install authorized keys
 81    %__install -d -m 700 -o nx -g nx %nx_homedir/.ssh/
 82    %__install -D -m 600 -o nx -g nx %_datadir/%{name}/authorized_keys.nomachine %nx_homedir/.ssh/authorized_keys
 83fi
 84/sbin/chkconfig --add neatx
 85/sbin/service neatx start > /dev/null 2>&1
 86
 87%files
 88%defattr(-,root,root)
 89%config(noreplace) /etc/neatx.conf
 90/etc/init.d/neatx
 91%_libdir/%{name}
 92%python_sitelib/%{name}/*
 93%doc %_docdir/%{name}
 94%_datadir/%{name}
 95%_var/lib/%{name}
 96
 97# not sure how to handle these. rpmlint doesn't report errors on -debuginfo package
 98#/usr/lib/debug/.build-id/bb/3398f400d7a44a6e0b8842c051dc378215bae8
 99#/usr/lib/debug/.build-id/bb/3398f400d7a44a6e0b8842c051dc378215bae8.debug
100#/usr/lib/debug/usr/local/lib/neatx/fdcopy.debug
101#/usr/src/debug/neatx-0.1/src/fdcopy.c
102
103
104%changelog
105
106* Tue Aug 1 2009 Alexander Todorov <alexx.todorov@NO_SPAM.gmail.com>  - 0.1-1
107- initial version of spec file