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