File test01.spec of Package test01
# spec file for package test01
# norootforbuild
%if 0%{?suse_version}
BuildRequires: libqt4-devel
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: gcc-c++ libstdc++-devel qt-devel
%endif
Name: test01
License: GPL
Group: Development/Languages/Other
Version: 0.0.1
Release: 1
URL: http://lostsoulofshinji.blogspot.com
Summary: A very simple test program
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A very simple test program which installs an executable in /usr/bin and
a configuration file in /etc/test01. Creating a sub-directory in /etc
is known to violate FHS 2.2.
%prep
# extract the source
# the following command is the simplest way to achieve this
%setup -q
%build
# Here, we are assuming that Fedora/RHEL/CentOS are similar.
# However, in actual installations, some, if not all, of the package names
# are different across these distributions.
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
qmake-qt4 -recursive
%else
qmake -recursive
%endif
make
%install
make INSTALL_ROOT=%buildroot install
%clean
rm -rf %buildroot
%files
%defattr(-,root,root,755)
/usr/bin/test01
%dir /etc/test01
%config /etc/test01/test01.conf
%changelog
* Wed Mar 25 2009 - franklin.chua@gmail.com
- New Package (Version 0.0.1)