Template Spec Files

From Rosalab Wiki
Revision as of 14:26, 22 July 2014 by D uragan (Talk | contribs) (Updated python template)

This is a page snapshot, showing old (but not deleted) versions of images and templates.
Jump to: navigation, search

Spec file for a program built using GNU Autotools

Summary:	foo
Name:		foo	
Version:	1.0
Release:	1
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

Summary:	foo
Name:		foo	
Version:	1.0
Release:	1
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 written in Qt4 and built using cmake

Summary:	foo
Name:		foo	
Version:	1.0
Release:	1
License:	foo
Group:		foo
Url:		foo
Source0:	%{name}-%{version}.tar.bz2
BuildRequires:  cmake
BuildRequires:  qt4-devel

%description
foo.

%files -n %{name}.lang

#------------------------------------------------------------------

%prep
%setup -q

%build
%cmake_qt4
%make

%install
%makeinstall_std -C build

%find_lang %{name}

Spec file for a program written in Qt5 and built using cmake

Summary:	foo
Name:		foo	
Version:	1.0
Release:	1
License:	foo
Group:		foo
Url:		foo
Source0:	%{name}-%{version}.tar.bz2
BuildRequires:  cmake
BuildRequires:  qt5-devel

%description
foo.

%files -n %{name}.lang

#------------------------------------------------------------------

%prep
%setup -q

%build
%cmake_qt5
%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

Summary:	foo
Name:           perl-%{upstream_name}
Version:        %perl_convert_version %{upstream_version}
Release:        1
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

Summary:	foo
Name:           perl-%{upstream_name}
Version:        %perl_convert_version %{upstream_version}
Release:        1
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
License:	Apache License
Group:		Development/Python
Url:		http://mypage.org/mymodule
Source0:        %{module}-%{version}.tar.gz
BuildRequires:	pkgconfig(python)
BuildArch:	noarch

%description
Example Python module.

%files -f FILELIST
%doc *.txt

#------------------------------------------------------------------

%prep
%setup -q

%install
PYTHONDONTWRITEBYTECODE=1  python setup.py install --root=%{buildroot} --record=FILELIST
# For safety - avoid "file listed twice" error
sed -i 's/.*egg-info$//' FILELIST

Spec file for a Library

%define major 1
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} -d

Summary:	foo
Name:		foo	
Version:	1.0
Release:	1
License:	foo
Group:		foo
Url:		foo
Source0:	%{name}-%{version}.tar.bz2

%description
foo.

#------------------------------------------------------------------

%package -n     %{libname}
Summary:        foo shared library
Group:		System/Libraries

%description -n %{libname}
foo shared library.

%files -n %{libname}
%{_libdir}/lib%{name}.so.%{major}*

#------------------------------------------------------------------

%package -n     %{devname}
Summary:        foo development files
Group:		Development/Other
Requires:       %{libname} = %{EVRD}
Provides:       %{name}-devel = %{EVRD}

%description -n %{devname}
foo development files.

%files -n %{devname}
%{_includedir}/*.h
%{_libdir}/*.so

#------------------------------------------------------------------

%prep
%setup -q

%build
%configure2_5x
%make

%install
%makeinstall_std

Spec file for a Node.js module

%define oname foo

Summary:        foo
Name:           nodejs-%{oname}
Version:        1.0
Release:        1
License:        foo
Group:          Development/Other
Url:            foo
Source0:        %{oname}-%{version}.tgz
BuildRequires:  nodejs-packaging
BuildArch:      noarch

%description
%{summary}.

%files
%doc LICENSE
%{nodejs_sitelib}/%{oname}

#------------------------------------------------------------------

%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