[cups-pdf] - fix title detection - fix build warning - rename INSTALL.fedora to INSTALL.RPM
Remi Collet
remi at fedoraproject.org
Tue Mar 19 13:26:36 UTC 2013
commit aabc88d43ffb6f2569478375d75595b33ec4c4fb
Author: Remi Collet <remi at fedoraproject.org>
Date: Tue Mar 19 14:26:28 2013 +0100
- fix title detection
- fix build warning
- rename INSTALL.fedora to INSTALL.RPM
.gitignore | 1 +
cups-pdf-build.patch | 35 +++++++++++++++++++++++++++++++++++
cups-pdf-title.patch | 22 ++++++++++++++++++++++
cups-pdf.spec | 48 ++++++++++++++++++++++++++++++------------------
4 files changed, 88 insertions(+), 18 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e82e379..45ef950 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+clog
*spec~
cups-pdf_2.5.0.tar.gz
/cups-pdf_2.5.1.tar.gz
diff --git a/cups-pdf-build.patch b/cups-pdf-build.patch
new file mode 100644
index 0000000..5c4f165
--- /dev/null
+++ b/cups-pdf-build.patch
@@ -0,0 +1,35 @@
+--- src/cups-pdf.c.build 2013-03-19 14:08:17.573134743 +0100
++++ src/cups-pdf.c 2013-03-19 14:13:00.517147964 +0100
+@@ -160,10 +160,6 @@
+
+ (void) umask(0077);
+
+- group=getgrnam(conf.grp);
+- if (group)
+- (void) setgid(group->gr_gid);
+-
+ if (strlen(conf.log)) {
+ if (stat(conf.log, &fstatus) || !S_ISDIR(fstatus.st_mode)) {
+ if (create_dir(conf.log, 1))
+@@ -176,12 +172,18 @@
+ logfp=fopen(logfile, "a");
+ }
+
+- if (!group) {
++ group=getgrnam(conf.grp);
++ if (group) {
++ if (setgid(group->gr_gid)) {
++ log_event(CPERROR, "Can't switch to new gid", conf.grp);
++ return 1;
++ } else {
++ log_event(CPDEBUG, "switching to new gid", conf.grp);
++ }
++ } else {
+ log_event(CPERROR, "Grp not found", conf.grp);
+ return 1;
+ }
+- else
+- log_event(CPDEBUG, "switching to new gid", conf.grp);
+
+ (void) umask(0022);
+
diff --git a/cups-pdf-title.patch b/cups-pdf-title.patch
new file mode 100644
index 0000000..cf4bd5e
--- /dev/null
+++ b/cups-pdf-title.patch
@@ -0,0 +1,22 @@
+--- src/cups-pdf.c.title 2013-03-19 13:51:28.699512894 +0100
++++ src/cups-pdf.c 2013-03-19 14:07:42.969010854 +0100
+@@ -426,12 +426,14 @@
+
+ static int preparetitle(char *title) {
+ char *cut;
+-
+- if (title != NULL) {
++
++ cut=strchr(title, '\r');
++ if (!cut)
++ cut=strchr(title, '\n');
++ if (cut) {
++ *cut = 0;
+ log_event(CPDEBUG, "removing trailing newlines from title", title);
+- while (strlen(title) && ((title[strlen(title)-1] == '\n') || (title[strlen(title)-1] == '\r')))
+- title[strlen(title)-1]='\0';
+- }
++ }
+ if (conf.decodehexstrings) {
+ log_event(CPSTATUS, "***Experimental Option: DecodeHexStrings", NULL);
+ log_event(CPDEBUG, "checking for hex strings", title);
diff --git a/cups-pdf.spec b/cups-pdf.spec
index e0fbb80..840cd07 100644
--- a/cups-pdf.spec
+++ b/cups-pdf.spec
@@ -2,7 +2,7 @@ Summary: Extension for creating pdf-Files with CUPS
Summary(fr): Extension de CUPS pour créer des fichiers PDF
Name: cups-pdf
Version: 2.6.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: Applications/Publishing
URL: http://www.cups-pdf.de/
License: GPLv2+
@@ -10,8 +10,14 @@ License: GPLv2+
Source0: http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/%{name}_%{version}.tar.gz
Source1: INSTALL.fedora.cups-pdf
+# Default value for Out ${DESKTOP}
Patch1: cups-pdf-conf.patch
+# Handle ${DESKTOP} from config
Patch2: cups-pdf-desktop.patch
+# Handle new lines in title
+Patch3: cups-pdf-title.patch
+# Fix build warning
+Patch4: cups-pdf-build.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cups-devel
@@ -58,36 +64,37 @@ Ce comportement peut être modifié en éditant le fichier de configuration.
%prep
echo CIBLE = %{name}-%{version}-%{release}
%setup -q -n %{name}-%{version}
-%{__cp} %{SOURCE1} INSTALL.fedora
+cp %{SOURCE1} INSTALL.RPM
-# Relocate output on user's Desktop
%patch1 -p0 -b .oldconf
%patch2 -p0 -b .desktop
+%patch3 -p0 -b .title
+%patch4 -p0 -b .build
%build
pushd src
-%{__cc} $RPM_OPT_FLAGS -o cups-pdf cups-pdf.c
+cc $RPM_OPT_FLAGS -o cups-pdf cups-pdf.c
popd
# Avoid perl dependencies
-%{__chmod} -x contrib/pstitleiconv-0.2/pstitleiconv
-%{__chmod} -x contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch
-%{__chmod} -x contrib/SELinux-HOWTO/update-module
+chmod -x contrib/pstitleiconv-0.2/pstitleiconv
+chmod -x contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch
+chmod -x contrib/SELinux-HOWTO/update-module
%install
rm -rf %{buildroot}
-%{__mkdir_p} %{buildroot}%{CPBACKEND}
-%{__mkdir_p} %{buildroot}%{CPSPOOL}
-%{__mkdir_p} %{buildroot}%{CPOUT}
-%{__mkdir_p} %{buildroot}%{CPLOG}
-%{__mkdir_p} %{buildroot}%{CPBACKEND}
-%{__mkdir_p} %{buildroot}%{ETCCUPS}
-%{__mkdir_p} %{buildroot}%{_datadir}/cups/model/
-%{__install} -m644 extra/CUPS-PDF.ppd %{buildroot}%{_datadir}/cups/model/
-%{__install} -m644 extra/cups-pdf.conf %{buildroot}%{ETCCUPS}/
-%{__install} -m700 src/cups-pdf %{buildroot}%{CPBACKEND}/
+mkdir -p %{buildroot}%{CPBACKEND}
+mkdir -p %{buildroot}%{CPSPOOL}
+mkdir -p %{buildroot}%{CPOUT}
+mkdir -p %{buildroot}%{CPLOG}
+mkdir -p %{buildroot}%{CPBACKEND}
+mkdir -p %{buildroot}%{ETCCUPS}
+mkdir -p %{buildroot}%{_datadir}/cups/model/
+install -m644 extra/CUPS-PDF.ppd %{buildroot}%{_datadir}/cups/model/
+install -m644 extra/cups-pdf.conf %{buildroot}%{ETCCUPS}/
+install -m700 src/cups-pdf %{buildroot}%{CPBACKEND}/
%clean
@@ -116,7 +123,7 @@ fi
%files
%defattr(-,root,root)
-%doc ChangeLog COPYING README INSTALL.fedora contrib/
+%doc ChangeLog COPYING README INSTALL.RPM contrib/
%dir %{CPSPOOL}
%dir %{CPOUT}
%attr(700, root, root) %{CPBACKEND}/cups-pdf
@@ -125,6 +132,11 @@ fi
%changelog
+* Tue Mar 19 2013 Remi Collet <remi at fedoraproject.org> 2.6.1-4
+- fix title detection
+- fix build warning
+- rename INSTALL.fedora to INSTALL.RPM
+
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the scm-commits
mailing list