Difference between revisions of "Template Spec Files"
From Rosalab Wiki
(Add cmake template) |
(+ Perl templates) |
||
Line 1: | Line 1: | ||
− | + | =Spec file for a program built using GNU Autotools= | |
<pre> | <pre> | ||
Line 32: | Line 32: | ||
</pre> | </pre> | ||
− | + | =Spec file for a program built using CMake= | |
<pre> | <pre> | ||
Line 63: | Line 63: | ||
%find_lang %{name} | %find_lang %{name} | ||
+ | </pre> | ||
+ | |||
+ | =Spec file for a program built using Perl/Makefile.PL= | ||
+ | <pre> | ||
+ | %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 | ||
+ | </pre> | ||
+ | |||
+ | =Spec file for a program built using Perl/Build.PL= | ||
+ | <pre> | ||
+ | %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} | ||
</pre> | </pre> |
Revision as of 15:02, 14 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} #----------------------------------------------- %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} #----------------------------------------------- %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}