@ -1,60 +1,66 @@
Name: perltidy
Name: perltidy
Version: 20130922
Version: 20130922
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Tool for indenting and reformatting Perl scripts
Summary: Tool for indenting and re-formatting Perl scripts
License: GPLv2+
License: GPLv2+
URL: http://perltidy.sourceforge.net/
URL: http://perltidy.sourceforge.net/
Source0: http://www.cpan.org/modules/by-module/Perl/Perl-Tidy-%{version}.tar.gz
Source0: http://www.cpan.org/modules/by-module/Perl/Perl-Tidy-%{version}.tar.gz
Source1: http://cdn.debian.net/debian/pool/main/p/perltidy/perltidy_20130922-1.debian.tar.xz
Source1: http://cdn.debian.net/debian/pool/main/p/perltidy/perltidy_20130922-1.debian.tar.xz
Patch0: %{name} -20130922-tmpnamdoc.patch
Patch0: perltidy -20130922-tmpnamdoc.patch
Patch1: Perl-Tidy-utf8.patch
BuildArch: noarch
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Carp)
BuildRequires: perl(Carp)
BuildRequires: perl(constant)
BuildRequires: perl(constant)
BuildRequires: perl(Cwd)
BuildRequires: perl(Cwd)
BuildRequires: perl(Exporter)
BuildRequires: perl(Exporter)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IO::File)
BuildRequires: perl(IO::File)
BuildRequires: perl(Test)
BuildRequires: perl(Test)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Provides: perl-Perl-Tidy = %{version}-%{release}
%description
%description
Perltidy is a Perl script which indents and re formats Perl scripts to
Perltidy is a Perl script that indents and re- formats Perl scripts to
make them easier to read. If you write Perl scripts, or spend much
make them easier to read. If you write Perl scripts, or spend much
time reading them, you will probably find it useful. The formatting
time reading them, you will probably find it useful. The formatting
can be controlled with command line parameters. The default parameter
can be controlled with command line parameters. The default parameter
settings approximately follow the suggestions in the Perl Style Guide.
settings approximately follow the suggestions in the Perl Style Guide.
Perltidy can also output HTML of both POD and source code. Besides
Perltidy can also output HTML of both POD and source code. Besides
reformatting scripts, Perltidy can be a great help in tracking down
re- formatting scripts, Perltidy can be a great help in tracking down
errors with missing or extra braces, parentheses, and square brackets
errors with missing or extra braces, parentheses, and square brackets
because it is very good at localizing errors.
because it is very good at localizing errors.
%prep
%prep
%setup -q -n Perl-Tidy-%{version} -a 1
%setup -q -n Perl-Tidy-%{version} -a 1
%{__patch} -p1 -i debian/patches/fix_insecure_tmpnam_usage_740670
# Fix from Debian for insecure temporary file usage (CVE-2014-2277, #1074721)
patch -p1 -i debian/patches/fix_insecure_tmpnam_usage_740670
# Related man page fix
%patch0 -p1
%patch0 -p1
rm -f docs/perltidy.1 examples/pt.bat
f=CHANGES ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
# Re-format documentation as UTF-8
%patch1
# Don't need Windows batch file
rm examples/pt.bat
# We'll ship the perltidy manpage in %%{_mandir} so we don't need another copy
rm docs/perltidy.1
%build
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
make %{?_smp_mflags}
%install
%install
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
make pure_install DESTDIR=%{buildroot}
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
%{_fixperms} %{buildroot}
%{_fixperms} $RPM_BUILD_ROOT/*
%check
%check
make test
make test
%files
%files
%doc BUGS CHANGES COPYING README TODO docs/ examples/
%doc BUGS CHANGES COPYING README TODO docs/ examples/
%{_bindir}/perltidy
%{_bindir}/perltidy
@ -62,8 +68,19 @@ make test
%{_mandir}/man1/perltidy.1*
%{_mandir}/man1/perltidy.1*
%{_mandir}/man3/Perl::Tidy.3*
%{_mandir}/man3/Perl::Tidy.3*
%changelog
%changelog
* Tue Mar 25 2014 Paul Howarth <paul@city-fan.org> - 20130922-2
- Cosmetic spec changes:
- Use tabs
- Comment patch applications
- Don't use macros for commands
- Use %%{buildroot} rather than $RPM_BUILD_ROOT
- Provide perl-Perl-Tidy for benefit of people looking for CPAN module
- Use a patch rather than scripted iconv run to fix character encoding
- BR: perl(Getopt::Long)
- Don't need to remove empty directories from the buildroot
- Use DESTDIR rather than PERL_INSTALL_ROOT
* Wed Mar 12 2014 Ville Skyttä <ville.skytta@iki.fi> - 20130922-1
* Wed Mar 12 2014 Ville Skyttä <ville.skytta@iki.fi> - 20130922-1
- Update to 20130922.
- Update to 20130922.
- Fix for CVE-2014-2277 from Debian (#1074721) + related man page fix.
- Fix for CVE-2014-2277 from Debian (#1074721) + related man page fix.