Difference between revisions of "Template Spec Files"
From Rosalab Wiki
(+ categories) |
(Added lib and nodejs examples) |
||
Line 14: | Line 14: | ||
foo | foo | ||
− | %files -n %{name} | + | %files -n %{name}.lang |
#----------------------------------------------- | #----------------------------------------------- | ||
Line 48: | Line 48: | ||
foo | foo | ||
− | %files -n %{name} | + | %files -n %{name}.lang |
#----------------------------------------------- | #----------------------------------------------- | ||
Line 167: | Line 167: | ||
%doc *.txt | %doc *.txt | ||
</pre> | </pre> | ||
+ | |||
+ | =Spec file for a Library= | ||
+ | |||
+ | <pre> | ||
+ | %define major 1 | ||
+ | %define libname %mklibname %{name} %{major} | ||
+ | %define develname %mklibname %{name} -d | ||
+ | |||
+ | Name: foo | ||
+ | Version: 1.0 | ||
+ | Release: 1 | ||
+ | Summary: foo | ||
+ | License: foo | ||
+ | Group: foo | ||
+ | URL: foo | ||
+ | Source0: %{name}-%{version}.tar.bz2 | ||
+ | |||
+ | %description | ||
+ | foo | ||
+ | |||
+ | %package -n %{libname} | ||
+ | Summary: Main library for gtkmm | ||
+ | |||
+ | %description -n %{libname} | ||
+ | foo shared library | ||
+ | |||
+ | %package -n %{develname} | ||
+ | Summary: Headers for developing programs that will use Gtk-- | ||
+ | Requires: %{libname} = %{EVRD} | ||
+ | |||
+ | %description -n %{develname} | ||
+ | foo development files | ||
+ | |||
+ | %files -n %{libname} | ||
+ | %{_libdir}/*.so.%{major}* | ||
+ | |||
+ | %files -n %{develname} | ||
+ | %{_includedir}/*.h | ||
+ | %{_libdir}/*.so | ||
+ | |||
+ | #----------------------------------------------- | ||
+ | |||
+ | %prep | ||
+ | %setup -q | ||
+ | |||
+ | %build | ||
+ | %configure2_5x | ||
+ | %make | ||
+ | |||
+ | %install | ||
+ | %makeinstall_std | ||
+ | </pre> | ||
+ | |||
+ | =Spec file for a Node.js module= | ||
+ | |||
+ | <pre> | ||
+ | %define oname foo | ||
+ | |||
+ | Name: nodejs-%{oname} | ||
+ | Version: 1.0 | ||
+ | Release: 1 | ||
+ | Summary: foo | ||
+ | Group: Development/Other | ||
+ | License: foo | ||
+ | URL: foo | ||
+ | Source0: %{oname}-%{version}.tgz | ||
+ | BuildArch: noarch | ||
+ | BuildRequires: nodejs-packaging | ||
+ | |||
+ | %description | ||
+ | %{summary}. | ||
+ | |||
+ | %prep | ||
+ | %setup -q -n package | ||
+ | rm -rf node_modules | ||
+ | |||
+ | %build | ||
+ | |||
+ | %install | ||
+ | mkdir -p %{buildroot}/%{nodejs_sitelib}/%{oname} | ||
+ | cp -r package.json index.js %{buildroot}/%{nodejs_sitelib}/%{oname} | ||
+ | %nodejs_symlink_deps | ||
+ | |||
+ | |||
+ | %files | ||
+ | %doc LICENSE | ||
+ | %{nodejs_sitelib}/%{oname} | ||
+ | </pre> | ||
+ | |||
[[Category:Package Management]] | [[Category:Package Management]] | ||
[[Category:Packaging Guidelines]] | [[Category:Packaging Guidelines]] | ||
[[Category:ROSA Developer Tools]] | [[Category:ROSA Developer Tools]] |
Revision as of 14:20, 18 July 2014
Contents
Spec file for a program built using GNU Autotools
Name: foo Version: 1.0 Release: 1 Summary: foo License: foo Group: foo URL: foo Source0: %{name}-%{version}.tar.bz2 %description foo %files -n %{name}.lang #----------------------------------------------- %prep %setup -q %build %configure2_5x %make %install %makeinstall_std %find_lang %{name}
Spec file for a program built using CMake
Name: foo Version: 1.0 Release: 1 Summary: foo License: foo Group: foo URL: foo Source0: %{name}-%{version}.tar.bz2 BuildRequires: cmake %description foo %files -n %{name}.lang #----------------------------------------------- %prep %setup -q %build %cmake %make %install %makeinstall_std -C build %find_lang %{name}
Spec file for a program built using Perl/Makefile.PL
%define upstream_name foo %define upstream_version 1.0 Name: perl-%{upstream_name} Version: %perl_convert_version %{upstream_version} Release: 1 Summary: foo License: foo Group: foo URL: foo Source0: %{upstream_name}-%{upstream_version}.tar.bz2 BuildRequires: perl-devel %description foo %files #----------------------------------------------- %prep %setup -qn %{upstream_name}-%{upstream_version} %build perl Makefile.PL INSTALLDIRS=vendor %make %check %make test %install %makeinstall_std
Spec file for a program built using Perl/Build.PL
%define upstream_name foo %define upstream_version 1.0 Name: perl-%{upstream_name} Version: %perl_convert_version %{upstream_version} Release: 1 Summary: foo License: foo Group: foo URL: foo Source0: %{upstream_name}-%{upstream_version}.tar.bz2 BuildRequires: perl-devel BuildRequires: perl(Module::Build) %description foo %files #----------------------------------------------- %prep %setup -qn %{upstream_name}-%{upstream_version} %build perl Build.PL installdirs=vendor ./Build CFLAGS="%{optflags}" %check ./Build test %install ./Build install destdir=%{buildroot}
Spec file for a Python module
%define module mymodule Summary: Example module Name: python-%{module} Version: 1.0 Release: 1 Source: %{module}-%{version}.tar.gz URL: http://mypage.org/mymodule License: Apache License Group: Development/Python BuildRequires: python-devel BuildArch: noarch %description Example Python module %prep %setup -q %install PYTHONDONTWRITEBYTECODE= python setup.py install --root=%{buildroot} --record=FILELIST # For safety - avoid "file listed twice" error sed -i 's/.*egg-info$//' FILELIST %files -f FILELIST %doc *.txt
Spec file for a Library
%define major 1 %define libname %mklibname %{name} %{major} %define develname %mklibname %{name} -d Name: foo Version: 1.0 Release: 1 Summary: foo License: foo Group: foo URL: foo Source0: %{name}-%{version}.tar.bz2 %description foo %package -n %{libname} Summary: Main library for gtkmm %description -n %{libname} foo shared library %package -n %{develname} Summary: Headers for developing programs that will use Gtk-- Requires: %{libname} = %{EVRD} %description -n %{develname} foo development files %files -n %{libname} %{_libdir}/*.so.%{major}* %files -n %{develname} %{_includedir}/*.h %{_libdir}/*.so #----------------------------------------------- %prep %setup -q %build %configure2_5x %make %install %makeinstall_std
Spec file for a Node.js module
%define oname foo Name: nodejs-%{oname} Version: 1.0 Release: 1 Summary: foo Group: Development/Other License: foo URL: foo Source0: %{oname}-%{version}.tgz BuildArch: noarch BuildRequires: nodejs-packaging %description %{summary}. %prep %setup -q -n package rm -rf node_modules %build %install mkdir -p %{buildroot}/%{nodejs_sitelib}/%{oname} cp -r package.json index.js %{buildroot}/%{nodejs_sitelib}/%{oname} %nodejs_symlink_deps %files %doc LICENSE %{nodejs_sitelib}/%{oname}