%global _enable_debug_package 0 %global debug_package %{nil} %global __os_install_post /usr/lib/rpm/brp-compress %{nil} #%define _binaries_in_noarch_packages_terminate_build 0 %define PKGNAME @PACKAGE_NAME@ %define VERSION @PACKAGE_VERSION@ # TODO fix %define RELEASE 1 %define RELEASE 1 Name: %{PKGNAME} Summary: Versatile toolbox for scientific analysis of astronomical gamma-ray data Version: %{VERSION} Release: %{RELEASE} License: GPLv3 Group: Development/Libraries Source0: http://cta.irap.omp.eu/ctools/releases/ctools/%{PKGNAME}-%VERSION.tar.gz #Source1: http://cta.irap.omp.eu/ctools/releases/gammalib/%{PKGNAME}-%VERSION.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot #BuildRequires: ncurses #BuildRequires: readline #BuildRequires: libstdc++-devel #BuildRequires: gcc-c++ #BuildRequires: automake #BuildRequires: autoconf #BuildRequires: libtool #BuildRequires: swig #BuildRequires: doxygen #BuildRequires: python-devel #BuildRequires: ncurses #BuildRequires: readline #BuildRequires: cfitsio # Requires: liste des packages requis pour l'installation Requires: ncurses Requires: readline Requires: cfitsio Requires: gammalib >= 1.2.0.dev1 # Prefix: /usr/local/gamma # URL: http://cta.irap.omp.eu/ctools #Description (max 79 caractères par ligne) %description Cherenkov Telescope Array Science Analysis Software # Préparation du package %prep %setup -q # Nettoyer le dossier temporaire (eventuellement precedents rpmbuild) rm -rf $HOME%{prefix} # Compilation du logiciel (execute ./configure et make) ./configure -prefix=$HOME%{prefix}/%{PKGNAME} make %check #make check # Installation de l'application (execute make install) %install export DONT_STRIP=1 make install #=================================================# # TODO : Add Information to RPM File # #=================================================# # TODO : fix folder and option # option 1 : this file is at the root of the package, and will not be installed # option 2 : this file is saved in %{prefix}/%{PKGNAME} folder # # --> How to extract files, # option 1: # rpm2cpio ctools-1.1.0-1.noarch.rpm | cpio -ivd /ctools.dist # rpm2cpio ctools-1.1.0-1.noarch.rpm | cpio -ivd /Licence.txt # option 2: result in $HOME/usr/local/gamma/ctools # rpm2cpio ctools-1.1.0-1.noarch.rpm | cpio -ivd /usr/local/gamma/ctools/ctools.dist # rpm2cpio ctools-1.1.0-1.noarch.rpm | cpio -ivd /usr/local/gamma/ctools/Licence.txt # Add information to rpm file # Option 1 : cat < $RPM_BUILD_ROOT/%{PKGNAME}.dist # Option 2 selected cat < $HOME/%{prefix}/%{PKGNAME}/%{PKGNAME}.dist '%{PKGNAME}' irap.omp.eu CTA Science Analysis Tools EOF # Add additional files to production folder # Option 1 : cp COPYING $RPM_BUILD_ROOT/License.txt # Option 2 selected cp COPYING $HOME/%{prefix}/%{PKGNAME}/License.txt # copie des fichiers de $HOME/usr dans $HOME/rpm/BUILDROOT/ctools-x.y.z-1.x86_64/ cp -R $HOME/usr $RPM_BUILD_ROOT/ # ============ Installation =============== install -m 0755 -d /%{prefix} # Nettoyage du package %clean rm -rf $RPM_BUILD_ROOT # Pre installation %pre # TODO : Création des utilisateurs, des groupes etc... # Post installation %post # TODO : Test installation ? # TODO : Ajout des scripts en crontab cd %{prefix}/%{PKGNAME}/bin ln -sf ../lib64/python2.6/site-packages/cscripts/cscaldb.py cscaldb ln -sf ../lib64/python2.6/site-packages/cscripts/csfindobs.py csfindobs ln -sf ../lib64/python2.6/site-packages/cscripts/csiactcopy.py csiactcopy ln -sf ../lib64/python2.6/site-packages/cscripts/csiactdata.py csiactdata ln -sf ../lib64/python2.6/site-packages/cscripts/csiactobs.py csiactobs ln -sf ../lib64/python2.6/site-packages/cscripts/csinfo.py csinfo ln -sf ../lib64/python2.6/site-packages/cscripts/cslightcrv.py cslightcrv ln -sf ../lib64/python2.6/site-packages/cscripts/csmodelinfo.py csmodelinfo ln -sf ../lib64/python2.6/site-packages/cscripts/csmodelmerge.py csmodelmerge ln -sf ../lib64/python2.6/site-packages/cscripts/csobs2caldb.py csobs2caldb ln -sf ../lib64/python2.6/site-packages/cscripts/csobsdef.py csobsdef ln -sf ../lib64/python2.6/site-packages/cscripts/csobsinfo.py csobsinfo ln -sf ../lib64/python2.6/site-packages/cscripts/cspull.py cspull ln -sf ../lib64/python2.6/site-packages/cscripts/csresmap.py csresmap ln -sf ../lib64/python2.6/site-packages/cscripts/csroot2caldb.py csroot2caldb ln -sf ../lib64/python2.6/site-packages/cscripts/cssens.py cssens ln -sf ../lib64/python2.6/site-packages/cscripts/csspec.py csspec ln -sf ../lib64/python2.6/site-packages/cscripts/cstsdist.py cstsdist ln -sf ../lib64/python2.6/site-packages/cscripts/cstsmapmerge.py cstsmapmerge ln -sf ../lib64/python2.6/site-packages/cscripts/cstsmapsplit.py cstsmapsplit ln -sf ../lib64/python2.6/site-packages/cscripts/csworkflow.py csworkflow # Pré désinstallation %preun # TODO : Backup database, configuration files etc... # Post désinstallation %postun # TODO : Suppression utilisateur etc... %changelog * Wed Mar 1 2017 SYLVIE BRAU-NOGUE (sylvie.brau-nogue@irap.omp.eu) - Packaging scripts included in the Makefile # Fichier embarqués %files %defattr(-,root,root,-) /* # TODO : Add the list of documentation files that are included in this package to the %doc directive #%doc README TODO COPYING ChangeLog # TODO : Affiner le placement des fichiers