htgoebel avatar htgoebel committed 5cd91da

Adding .spec file.

Comments (0)

Files changed (1)

rpm-filetrigger-python.spec

+Summary: RPM filetrigger script for compiling Python files
+Name:    rpm-filetrigger-python
+Version: 2011116
+Release: %mkrel 1
+Source0: %{name}-%{version}.tar.gz
+License: GPL 3.0
+Group:   Development/Libraries
+Prefix:  %{_prefix}
+BuildArch: noarch
+Vendor: Hartmut Goebel <h.goebel@goebel-consult.de
+
+Requires: python
+Requires: bash
+
+%description
+This package installs a filetrigger to compile the Python modules on
+installation and remove them on uninstallation of the respective
+package.
+
+Install this package if you want your Python modules precompiled.
+
+Please note: You will not find the byte-code files listed by RPM,
+since they are not added to the database.
+
+%prep
+%setup -q
+
+%install
+install -d -m 0755 %buildroot%{_var}/lib/rpm/filetriggers
+install -m 0644 python-compile.filter %buildroot%{_var}/lib/rpm/filetriggers
+install -m 0755 python-compile.script %buildroot%{_var}/lib/rpm/filetriggers
+
+%clean
+rm -fr %buildroot
+
+%post
+site_packages=$(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
+python    -m compileall "$site_packages"
+python -O -m compileall "$site_packages"
+
+%files
+%defattr(-,root,root)
+%{_var}/lib/rpm/filetriggers/python-compile.*
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.