-# TODO
-# - optlfags
Summary: Open Source CSS parser and optimiser
Summary(pl.UTF-8): Analizator i optymalizator CSS z otwartymi źródłami
Name: csstidy
Version: 1.4
-Release: 0.3
+Release: 1
License: GPL v2+
Group: Applications/WWW
Source0: http://dl.sourceforge.net/project/csstidy/CSSTidy%20%28C%2B%2B%2C%20stable%29/1.3/%{name}-source-%{version}.zip
-# Source0-md5: 7087cc0c6cfdb42a3e796621a5d12a09
+# Source0-md5: 8fcbf5c1c3cafd9232552b3286aabcb9
Source1: http://ftp.debian.org/debian/pool/main/c/csstidy/%{name}_%{version}-3.diff.gz
-# Source1-md5: 8fcbf5c1c3cafd9232552b3286aabcb9
+# Source1-md5: 7087cc0c6cfdb42a3e796621a5d12a09
+Patch0: scons-optflags.patch
URL: http://csstidy.sourceforge.net/
BuildRequires: libstdc++-devel
BuildRequires: sed >= 4.0
%{__gzip} -dc %{S:1} | %{__patch} -p1
%{__patch} -p1 < debian/patches/001_emptyfile.dpatch
%{__patch} -p1 < debian/patches/002_gcc43fix.dpatch
+%patch0 -p1
%build
%scons
--- /dev/null
+--- csstidy-1.4/SConstruct~ 2009-12-10 16:46:51.000000000 +0200
++++ csstidy-1.4/SConstruct 2009-12-10 16:46:55.184590309 +0200
+@@ -12,13 +12,24 @@
+ #tell the user what we're doing
+ print '**** Compiling in ' + mymode + ' mode...'
+
+-debugcflags = ['-Wall', '-g', '-pedantic'] #extra compile flags for debug
+-releasecflags = ['-O2'] #extra compile flags for release
++CXX = ARGUMENTS.get('CXX')
++CXXFLAGS = ARGUMENTS.get('CXXFLAGS')
++
++if CXXFLAGS:
++ debugcxxflags = releasecxxflags = CXXFLAGS.split(' ');
++else:
++ debugcxxflags = ['-Wall', '-g', '-pedantic'] #extra compile flags for debug
++ releasecxxflags = ['-O2'] #extra compile flags for release
++
++if CXX:
++ debugcxx = releasecxx = CXX
++else:
++ debugcxx = releasecxx = 'g++'
+
+ env = Environment()
+
+ #make sure the sconscripts can get to the variables
+-Export('env', 'mymode', 'debugcflags', 'releasecflags')
++Export('env', 'mymode', 'debugcxx', 'debugcxxflags', 'releasecxx', 'releasecxxflags')
+
+ #put all .sconsign files in one place
+ env.SConsignFile()
+--- csstidy-1.4/csstidy/SConscript~ 2009-12-10 16:46:42.000000000 +0200
++++ csstidy-1.4/csstidy/SConscript 2009-12-10 16:46:46.397716113 +0200
+@@ -3,8 +3,8 @@
+ import glob
+
+ #get all the build variables we need
+-Import('env', 'project', 'mymode', 'debugcflags', 'releasecflags')
+-localenv = env.Copy()
++Import('env', 'project', 'mymode', 'debugcxx', 'debugcxxflags', 'releasecxx', 'releasecxxflags')
++localenv = env.Clone()
+
+ buildroot = '../' + mymode #holds the root of the build directory tree
+ builddir = buildroot + '/' + project #holds the build directory for this project
+@@ -13,9 +13,11 @@
+ #append the user's additional compile flags
+ #assume debugcflags and releasecflags are defined
+ if mymode == 'debug':
+- localenv.Append(CCFLAGS=debugcflags)
++ localenv['CXX']=debugcxx
++ localenv.Append(CXXFLAGS=debugcxxflags)
+ else:
+- localenv.Append(CCFLAGS=releasecflags)
++ localenv['CXX']=releasecxx
++ localenv.Append(CXXFLAGS=releasecxxflags)
+
+ #specify the build directory
+ localenv.BuildDir(builddir, ".", duplicate=0)