# determine what platform we are building on %define fedora 0 %define suse 0 %define mdk 0 %if %{_vendor} == redhat %define fedora 1 %define _dist %(grep Fedora /etc/redhat-release) %endif %if %{_vendor} == suse %define suse 1 %define _dist %(grep SuSE /etc/SuSE-release) %endif %if %{_vendor} == mandrake %define mdk 1 %define _dist %(grep Mandrake /etc/mandrake-release) %endif %if ! %{fedora} && ! %{suse} && ! %{mdk} %{error: Unknown platform. Please examine the spec file.} exit 1 %endif # as there is already a package pd (no relation to this) with # executable /usr/bin/pd we are changing the name to pls %define _name pd Summary: Replacement for ls command Name: pls Version: 5.1.1 Release: 1 Group: Applications/File Copyright: CDDL v1 Distribution: %{_dist} Source: %{_name}_%{version}.tar.gz Patch: %{_name}_%{version}.patch BuildRoot: %{_tmppath}/%{_name}-root URL: http://users.foxvalley.net/~sfehrman/pd/ Packager: D. Scott Barninger BuildRequires: glibc-devel %if !%{mdk} BuildRequires: ncurses-devel %endif Requires: glibc ncurses %description This program will read the current directory or the directories listed on the command line and display the contents showing the "files" first then the "directories". This program can be used instead of "ls". %prep %setup -n %{_name}_%{version} # patch the man page to change name to pls %patch -p1 %build %configure make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT" make DESTDIR=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT/usr/bin/pd $RPM_BUILD_ROOT/usr/bin/pls mv $RPM_BUILD_ROOT/usr/share/man/man1/pd.1 $RPM_BUILD_ROOT/usr/share/man/man1/pls.1 %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT" %files %defattr(-,root,root) /usr/bin/pls /usr/share/man/man1/pls.1.gz %doc AUTHORS COPYING NEWS README ChangeLog %changelog * Sun Mar 27 2005 D. Scott Barninger - initial spec file