Hey,
i'm currently trying to understand/apply gil_'s patch for gant (i.e. what exactly does fix my issues).
E.g. i want to apply the simple patch below. But if i put that as test.patch to ~/rpmbuild/SOURCES , and change my gant.spec like below, I receive erros - although the patch itself applies successfully. I think i have also the correct path in my patch file, because before the patches are applied, the dictionary is changed to Gant-1.9.11/ . Also changing the file names in the patchfile doesn't help( e.g. "--- build.gradle $(date) \n +++ build.gradle-test $(date) " or sth else. )
How can i solve this issue?
--- build.gradle 2014-05-05 17:07:24.000000000 +0200 +++ build.gradle 2016-07-31 15:08:04.902566307 +0200 @@ -194,7 +194,7 @@ final copyrightString = 'Copyright © 2006–2013 The Codehaus. All Rights Reserved.' javadoc{ options{ - overview 'overview.html' + overview '../overview.html' showAll() encoding 'UTF-8' setUse true @@ -210,7 +210,7 @@ javadoc.options.docTitle = javadoc.title } groovydoc{ - overview = 'overview.html' + overview = '../overview.html' includePrivate = false use = true windowTitle = packageTitle @@ -566,7 +566,7 @@ 'LICENCE.txt', 'README_Install.txt', 'releaseNotes.txt', - 'overview.html', + '../overview.html', ]
task srcTgz(type: Tar, description: 'Create a tarball of the source.') {
_________________[end snippet]________________________-
%global gmajver 2.3 Name: gant Version: 1.9.11 Release: 1%{?dist} Summary: Groovy-based build system that uses Ant tasks Group: Development/Tools License: ASL 2.0 URL: http://gant.github.io/ Source0: https://github.com/Gant/Gant/archive/%%7Bversion%7D.tar.gz Source1: https://repo1.maven.org/maven2/org/codehaus/gant/gant_groovy%%7Bgmajver%7D/%... Source2: %{name}-script
Patch0: test.patch
BuildArch: noarch BuildRequires: gradle-local BuildRequires: javapackages-local
BuildRequires: java-devel BuildRequires: jpackage-utils
BuildRequires: antlr-tool BuildRequires: objectweb-asm # main deps BuildRequires: ant BuildRequires: apache-commons-cli BuildRequires: groovy
BuildRequires: gradle
# test deps BuildRequires: apache-ivy BuildRequires: junit
Requires: ant Requires: antlr-tool Requires: apache-commons-cli Requires: groovy Requires: objectweb-asm
Requires: java-devel
%description Gant is a tool for scripting Ant tasks using Groovy instead of XML [...]
%package javadoc Group: Documentation Summary: Javadoc for %{name}
%description javadoc This package contains javadoc for %{name}.
%prep %autosetup -n Gant-%{version} find . -name "*.bat" -delete find . -name "*.class" -delete find . -name "*.jar" -delete
%patch0 -p0
%build sed -i '/metaInf/d' $PWD/build.gradle %gradle_build --skip-javadoc --xmvn-debug %install %mvn_install -J %{_javadocdir}/%{name}
%files -f .mfiles #%files javadoc -f .mfiles-javadoc
%changelog * Thu Oct 04 2012 gil cattaneo puntogil@libero.it 1.9.8-1 - update to 1.9.8
_________________[end snippet]________________________-
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7YlST9 + umask 022 + cd /home/toogley/rpmbuild/BUILD + cd /home/toogley/rpmbuild/BUILD + rm -rf Gant-1.9.11 + /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd Gant-1.9.11 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch + /usr/bin/patch -s + find . -name '*.bat' -delete + find . -name '*.class' -delete + find . -name '*.jar' -delete + echo 'Patch #0 (test.patch):' Patch #0 (test.patch): + /usr/bin/patch -p0 --fuzz=0 patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] y Hunk #1 FAILED at 194. Hunk #2 FAILED at 210. Hunk #3 FAILED at 566. 3 out of 3 hunks FAILED -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RtJaSm + umask 022 + cd /home/toogley/rpmbuild/BUILD + cd /home/toogley/rpmbuild/BUILD + rm -rf Gant-1.9.11 + /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd Gant-1.9.11 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch + /usr/bin/patch -s + find . -name '*.bat' -delete + find . -name '*.class' -delete + find . -name '*.jar' -delete + echo 'Patch #0 (test.patch):' Patch #0 (test.patch): + /usr/bin/patch -p0 --fuzz=0 patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
_________________[end snippet]________________________-
Il 31/07/2016 15:57, toogley ha scritto:
Hey,
i'm currently trying to understand/apply gil_'s patch for gant (i.e. what exactly does fix my issues).
E.g. i want to apply the simple patch below. But if i put that as test.patch to ~/rpmbuild/SOURCES , and change my gant.spec like below, I receive erros - although the patch itself applies successfully. I think i have also the correct path in my patch file, because before the patches are applied, the dictionary is changed to Gant-1.9.11/ . Also changing the file names in the patchfile doesn't help( e.g. "--- build.gradle $(date) \n +++ build.gradle-test $(date) " or sth else. )
How can i solve this issue?
--- build.gradle 2014-05-05 17:07:24.000000000 +0200 +++ build.gradle 2016-07-31 15:08:04.902566307 +0200 @@ -194,7 +194,7 @@ final copyrightString = 'Copyright © 2006–2013 The Codehaus. All Rights Reserved.' javadoc{ options{
overview 'overview.html'
overview '../overview.html' showAll() encoding 'UTF-8' setUse true@@ -210,7 +210,7 @@ javadoc.options.docTitle = javadoc.title } groovydoc{
- overview = 'overview.html'
- overview = '../overview.html' includePrivate = false use = true windowTitle = packageTitle
@@ -566,7 +566,7 @@ 'LICENCE.txt', 'README_Install.txt', 'releaseNotes.txt',
- 'overview.html',
'../overview.html', ]
task srcTgz(type: Tar, description: 'Create a tarball of the source.') {
_________________[end snippet]________________________-
before you should changes spec file in this way
Name: gant Version: 1.9.11 Release: 1%{?dist} Summary: Groovy-based build system that uses Ant tasks Group: Development/Tools License: ASL 2.0 URL: http://gant.github.io/ Source0: https://github.com/Gant/Gant/archive/%%7Bversion%7D.tar.gz Source2: %{name}-script
Patch0: test.patch
BuildArch: noarch BuildRequires: gradle-local
# main deps BuildRequires: ant BuildRequires: apache-commons-cli BuildRequires: groovy # build deps BuildRequires: gradle-local # test deps BuildRequires: apache-ivy BuildRequires: junit
Requires: java-devel
%description Gant is a tool for scripting Ant tasks using Groovy instead of XML [...]
%package javadoc Summary: Javadoc for %{name}
%description javadoc This package contains javadoc for %{name}.
%prep %autosetup -n Gant-%{version} find . -name "*.bat" -delete find . -name "*.class" -delete find . -name "*.jar" -delete
%patch0 -p0
sed -i '/metaInf/d' $PWD/build.gradle
%build
%gradle_build --skip-javadoc --xmvn-debug %install
%mvn_install -J gant/build/docs/javadoc
%files -f .mfiles
%doc README.md %license LICENCE.txt
%files javadoc -f .mfiles-javadoc
%license LICENCE.txt
try to change %autosetup with %setup and as i wrote in the previous emails disable useless 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' tasks we don't have old groovy 2.x release Regards .g
_________________[end snippet]________________________-
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7YlST9
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] y Hunk #1 FAILED at 194. Hunk #2 FAILED at 210. Hunk #3 FAILED at 566. 3 out of 3 hunks FAILED -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RtJaSm
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
_________________[end snippet]________________________-
java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
hey gil,
On 07/31, gil wrote:
before you should changes spec file in this way
okay, done.
%prep %autosetup -n Gant-%{version}
[...]
try to change %autosetup with %setup
Ah. i changed %setup to %autosetup, because i missed that %setup has the option -n to specify the directory. i've changed it back again.
and as i wrote in the previous emails disable useless 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' tasks we don't have old groovy 2.x release
okay, done.
_________________[end snippet]________________________-
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7YlST9
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] y Hunk #1 FAILED at 194. Hunk #2 FAILED at 210. Hunk #3 FAILED at 566. 3 out of 3 hunks FAILED -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RtJaSm
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
_________________[end snippet]________________________-
java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
-- java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
Hey gil again,
just that you don't missunderstand me: I've read your suggestions/mails, and I think i understand most of it. But i want to reproduce a working build based on the specfile. That means, i wanted to first understand how patches work with the specfile (or rather where my error with my small patch was). After that, i wanted to implement your suggestions/ideas in a clean way.
That's why the small patch didn't contained the removal of the grooval versions - which I understand are useleless in fedora.
regards, tobi/toogley
On 08/02, toogley wrote:
hey gil,
On 07/31, gil wrote:
before you should changes spec file in this way
okay, done.
%prep %autosetup -n Gant-%{version}
[...]
try to change %autosetup with %setup
Ah. i changed %setup to %autosetup, because i missed that %setup has the option -n to specify the directory. i've changed it back again.
and as i wrote in the previous emails disable useless 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' tasks we don't have old groovy 2.x release
okay, done.
_________________[end snippet]________________________-
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7YlST9
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] y Hunk #1 FAILED at 194. Hunk #2 FAILED at 210. Hunk #3 FAILED at 566. 3 out of 3 hunks FAILED -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RtJaSm
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
_________________[end snippet]________________________-
java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
-- java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
-- java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
Il 02/08/2016 17:13, toogley ha scritto:
Hey gil again,
just that you don't missunderstand me: I've read your suggestions/mails, and I think i understand most of it. But i want to reproduce a working build based on the specfile. That means, i wanted to first understand how patches work with the specfile (or rather where my error with my small patch was). After that, i wanted to implement your suggestions/ideas in a clean way.
That's why the small patch didn't contained the removal of the grooval versions
- which I understand are useleless in fedora.
regards, tobi/toogley
On 08/02, toogley wrote:
hey gil,
On 07/31, gil wrote:
before you should changes spec file in this way
okay, done.
>%prep >%autosetup -n Gant-%{version}
[...]
try to change %autosetup with %setup
Ah. i changed %setup to %autosetup, because i missed that %setup has the option -n to specify the directory. i've changed it back again.
now the patch is successful? i use this patch:
``` diff -Nru Gant-1.9.11/build.gradle Gant-1.9.11.build/build.gradle --- Gant-1.9.11/build.gradle 2014-05-05 17:07:24.000000000 +0200 +++ Gant-1.9.11.build/build.gradle 2016-07-29 19:32:59.127468016 +0200 @@ -56,47 +56,8 @@ final groovyArtefactName = 'groovy-all'
ext.groovyVersions = [ - '2.0': '2.0.8', - '2.1': '2.1.9', - '2.2': '2.2.2', - '2.3': '2.3.0', ]
-// One series of Groovy needs using for the standalone distribution. This version of Groovy will be packaged with -// the "standalone" distribution of Gant. It will generally be the latest widely available released version of Groovy. - -final groovyStandaloneSeries = '2.2' - -// Organize the build using subprojects. There is a subproject gant which is for the build using the -// locally installed Groovy and there is one for each version of Groovy obtained from the Maven repository -// that is supported. These functions ease doing the iteration over all the subprojects. NB Gradle -// requires the directories for each of the subprojects to exist. There is an assumption that each -// subproject has its own source, etc. This build slightly perverts the general approach by using exactly -// the same source for each subproject, the only difference is the version of Groovy used for compilation. - -def forEachDistributionVersion(Closure c) { - groovyVersions.keySet().each{String s -> c(artifact + mavenNameExtension + s) } -} - -def forEachProject(Closure c) { - c artifact - forEachDistributionVersion c -} - -forEachProject{item -> if (! new File(item).isDirectory()) { mkdir item }} - -ext.distributionTasks = [] -ext.debTasks = [] - -// Using the JackRabbit wagon gets round some problems associated with uploading the distributions that -// occurs with the standard wagon. However, it does not solve the problem of not creating missing -// directories that gives difficulties with new artefact uploads. Have to cadaver in and create the -// hierarchy first:-( Using the lightweight HTTP wagon still requires creating the directory structure -// with cadaver or equivalent:-( - -final webdavWagonName = 'org.apache.maven.wagon:wagon-webdav-jackrabbit:2.5' -//final webdavWagonName = 'org.apache.maven.wagon:wagon-http-lightweight:2.5' - // In creating distributions which include jar files for the source, javadoc, and groovydoc, it is // imperative to ensure that they do not get located into the library directory for jars containing // compiled code for execution: it is critical to avoid getting the source, javadoc, and groovydoc jars on @@ -133,7 +94,6 @@ test{groovy{srcDir '../src/test/groovy'}} integTest{groovy{srcDir '../src/integTest/groovy'}} } - metaInf << fileTree(dir: '..').matching{include 'LICENCE.txt'} final theVendor = 'The Codehaus' final theTitle = 'Gant: Scripting Ant tasks with Groovy.' jar{ @@ -158,8 +118,8 @@ } } repositories{ - if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { mavenLocal() } - mavenCentral() + if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { xmvn() } + xmvn() maven{url 'http://repository.codehaus.org/%27%7D } dependencies{ @@ -169,7 +129,6 @@ ) testCompile 'junit:junit:4.11' testRuntime 'org.apache.ivy:ivy:2.3.0' - deployJars webdavWagonName } compileGroovy.options.compilerArgs = ['-Xlint'] [compileGroovy, compileTestGroovy]*.options*.encoding = 'UTF-8' @@ -194,7 +153,7 @@ final copyrightString = 'Copyright © 2006–2013 The Codehaus. All Rights Reserved.' javadoc{ options{ - overview 'overview.html' + overview '../overview.html' showAll() encoding 'UTF-8' setUse true @@ -210,7 +169,7 @@ javadoc.options.docTitle = javadoc.title } groovydoc{ - overview = 'overview.html' + overview = '../overview.html' includePrivate = false use = true windowTitle = packageTitle @@ -266,10 +225,6 @@ repositories{flatDir(name: 'groovyInstallation', dirs: [new File(groovyHome, 'embeddable'), groovyLib])} versionMessage = 'Using Groovy version ' + groovyVersion + ' from ' + groovyHome } - else { - groovyVersion = groovyVersions[groovyStandaloneSeries] - versionMessage = 'Using Groovy version ' + groovyVersion - } dependencies{compile(group: 'org.codehaus.groovy', name: groovyArtefactName, version: groovyVersion)} compileGroovy.doFirst{println('\n\t' + versionMessage +'\n')} final buildPath = [System.properties.'user.dir', 'gant', 'build', 'classes'] @@ -339,130 +294,21 @@ } }
-forEachDistributionVersion{projectName-> - final groovyVersion = groovyVersions[projectName.replace(artifact + mavenNameExtension, '')] - project(projectName){ - apply plugin: 'maven' - dependencies{compile(group: 'org.codehaus.groovy', name: groovyArtefactName, version: groovyVersion)} - compileGroovy.doFirst{println('\n\tUsing Groovy version ' + groovyVersion + '\n')} - final buildPath = [System.properties.'user.dir', projectName, 'build', 'classes'] - final classPath = [] - classPath << (buildPath + ['main']).join(File.separator) - classPath << (buildPath + ['test']).join(File.separator) - configurations.testRuntime.files.each{file -> classPath << file.parent} - test.environment([ - GROOVY_ANT_TASK_TEST_VERSION: groovyVersion, - gradleClasspathString: classPath.join(System.properties.'path.separator') - ]) - install.repositories.mavenInstaller{pom pomSpecification} - gradle.taskGraph.whenReady{taskGraph -> - if (taskGraph.hasTask(uploadArchives)) { - if (! project.hasProperty('gant_experimentalMavenRepository') && !(project.hasProperty('codehausUsername') && project.hasProperty('codehausPassword'))) { - throw new RuntimeException('Must define both codehausUsername and codehausPassword to upload archives.') - } - if (! signingPropertiesAreSet()) { - throw new RuntimeException('Must define signing.keyId, signing.password, and signing.secretKeyRingFile') - } - uploadArchives.repositories.mavenDeployer{ - uniqueVersion = false - configuration = configurations.deployJars - beforeDeployment{MavenDeployment deployment -> signing.signPom(deployment)} - if (project.hasProperty('gant_experimentalMavenRepository')) { - if (! gant_experimentalMavenRepository) { throw new RuntimeException('gant_experimentalMavenRepository value not reasonable.') } - repository url: "file://${rootProject.buildDir}/${gant_experimentalMavenRepository}" - } - else { - //repository(url: 'dav:https://dav.codehaus.org/repository/gant/%27)%7B - repository(url: 'https://dav.codehaus.org/repository/gant/%27)%7B - authentication userName: codehausUsername, password: codehausPassword - } - //snapshotRepository(url: 'dav:https://dav.codehaus.org/snapshots.repository/gant/%27)%7B - snapshotRepository(url: 'https://dav.codehaus.org/snapshots.repository/gant/%27)%7B - authentication userName: codehausUsername, password: codehausPassword - } - } - pom pomSpecification - } - } - } - final binCopySpec = copySpec{ - final scriptsDirectory = '../scripts' - from('..'){include 'README*'} - into('conf'){from(scriptsDirectory + '/conf'){include '*.conf'}} - into('lib'){ - from libsDir - rename projectName + '-' + version, artifact + '-' + version + mavenNameExtension + '-' + groovyVersion - } - into('bin'){ - fileMode = 0755 - from([scriptsDirectory + '/bin', scriptsDirectory + '/bin_requiresGroovy']) - filter ReplaceTokens, tokens: [ - GROOVYPATH: 'embeddable', - GROOVYJAR: groovyArtefactName + '-' + groovyVersion + '.jar' - ] - } - } - task binTgz(type: Tar, dependsOn: 'jar', description: 'Build the distribution tarball.') { - baseName = artifact - classifier = mavenNameExtension + '-' + groovyVersion - compression = Compression.GZIP - into(gantPrefix){with binCopySpec} - } - task binZip(type: Zip, dependsOn: 'jar', description: 'Build the distribution zip file.') { - baseName = artifact - classifier = mavenNameExtension + '-' + groovyVersion - into(gantPrefix){with binCopySpec} - } - distributionTasks += [binTgz, binZip] - } - // Due to weird effective scoping of projects -- caused by cloning of bindings for projects? -- need to - // do the following to get the above tasks into the list defined by the main script. - distributionTasks += project(projectName).distributionTasks - ciBuildTasks << projectName + ':build' -} - -// ===================================================================== -// -// Create the standalone distribution. - -final projectNameForStandalone = 'gant_groovy' + groovyStandaloneSeries - -final standaloneCopySpec = copySpec{ - final scriptsDirectory = 'scripts' - final projectBase = project projectNameForStandalone - from('.'){include 'README*'} - into('conf'){from(scriptsDirectory + '/conf'){include '*.conf'}} - into('lib'){ - from projectBase.libsDir - from projectBase.configurations.runtime - } - into('bin'){ - fileMode = 0755 - from([scriptsDirectory + '/bin', scriptsDirectory + '/bin_standalone']) - filter ReplaceTokens, tokens: [ - GROOVYPATH: 'lib', - GROOVYJAR: groovyArtefactName + '-' + groovyVersions[groovyStandaloneSeries] + '.jar' - ] - } -} - -task standaloneBinTgz(type: Tar, dependsOn: projectNameForStandalone + ':jar', description: 'Create a tarball of the standalone distribution.') { +task standaloneBinTgz(type: Tar, dependsOn: ':jar', description: 'Create a tarball of the standalone distribution.') { baseName = artifact version = gantVersion compression = Compression.GZIP destinationDir = buildDir - into(gantPrefix){with standaloneCopySpec} + into(gantPrefix){} }
-task standaloneBinZip(type: Zip, dependsOn: projectNameForStandalone + ':jar', description: 'Create a zip file of the standalone distribution.') { +task standaloneBinZip(type: Zip, dependsOn: ':jar', description: 'Create a zip file of the standalone distribution.') { baseName = artifact version = gantVersion destinationDir = buildDir - into(gantPrefix){with standaloneCopySpec} + into(gantPrefix){} }
-distributionTasks += [standaloneBinTgz, standaloneBinZip] - // ===================================================================== // // Create the deb file of the standalone distribution. @@ -530,7 +376,6 @@ //} }
-debTasks << standaloneDeb
// ===================================================================== // @@ -551,8 +396,6 @@ into(gantPrefix + '/docs'){from project(':gant').docsDir} }
-distributionTasks += [docTgz, docZip] - // ===================================================================== // // Create the source distribution. @@ -566,7 +409,7 @@ 'LICENCE.txt', 'README_Install.txt', 'releaseNotes.txt', - 'overview.html', + '../overview.html', ]
task srcTgz(type: Tar, description: 'Create a tarball of the source.') { @@ -584,8 +427,6 @@ into(gantPrefix){from(projectDir){srcContent.each{include it}}} }
-distributionTasks += [srcTgz, srcZip] - // ===================================================================== // // Tasks for getting all the distribution materials uploaded to Codehaus. @@ -604,8 +445,8 @@ else { configurations{upload} repositories{ - if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { mavenLocal() } - mavenCentral() + if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { xmvn() } + xmvn() } dependencies { upload 'com.googlecode.sardine:sardine:146' } assert uploadSpec.size() == 2 @@ -616,7 +457,7 @@ } }
-task buildDistribution(dependsOn: distributionTasks, description: 'Build all the uploadable distribution archives.') +task buildDistribution
task uploadDistribution(dependsOn: buildDistribution, description: 'Upload all the distribution archives.') << { checkAuthority() @@ -632,27 +473,13 @@ // // Tasks for getting all the debs uploaded to Codehaus.
-task buildDebs(dependsOn: debTasks, description: 'Build all the uploadable debs.') - -task uploadDebs(dependsOn: buildDebs, description: 'Upload all the debs.') << { - checkAuthority() - undertakeUpload( - { - debTasks.each{task -> from task} - into rootProject.buildDir.absolutePath + '/' + gant_experimentalDistributionLocation + '/debs' - }, - ['debs', debTasks]) -} -
// ===================================================================== // // Do a complete release.
final archivesUploadTasks = [] -forEachDistributionVersion{archivesUploadTasks << ':' + it + ':uploadArchives'}
-task uploadRelease(dependsOn: archivesUploadTasks + [uploadDistribution, uploadDebs], description: 'Upload all elements of a release.')
// ===================================================================== // diff -Nru Gant-1.9.11/settings.gradle Gant-1.9.11.build/settings.gradle --- Gant-1.9.11/settings.gradle 2014-05-05 17:07:24.000000000 +0200 +++ Gant-1.9.11.build/settings.gradle 2016-08-02 17:30:25.880810257 +0200 @@ -14,4 +14,4 @@ // // Author: Russel Winder russel@winder.org.uk
-include 'gant', 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' +include 'gant'
``` regards .g
Il 02/08/2016 17:13, toogley ha scritto:
Hey gil again,
just that you don't missunderstand me: I've read your suggestions/mails, and I think i understand most of it. But i want to reproduce a working build based on the specfile. That means, i wanted to first understand how patches work with the specfile (or rather where my error with my small patch was). After that, i wanted to implement your suggestions/ideas in a clean way.
That's why the small patch didn't contained the removal of the grooval versions
- which I understand are useleless in fedora.
regards, tobi/toogley
the patch is available here https://gil.fedorapeople.org/gant-1.9.11-build.patch please, use %setup. it work with patches generate simply with diff (in my case, which then they are specific to Fedora) regards .g
On 08/02, toogley wrote:
hey gil,
On 07/31, gil wrote:
before you should changes spec file in this way
okay, done.
%prep %autosetup -n Gant-%{version}
[...]
try to change %autosetup with %setup
Ah. i changed %setup to %autosetup, because i missed that %setup has the option -n to specify the directory. i've changed it back again.
and as i wrote in the previous emails disable useless 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' tasks we don't have old groovy 2.x release
okay, done.
_________________[end snippet]________________________-
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7YlST9
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] y Hunk #1 FAILED at 194. Hunk #2 FAILED at 210. Hunk #3 FAILED at 566. 3 out of 3 hunks FAILED -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.7YlST9 (%prep)
$ rpmbuild -bb gant.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RtJaSm
- umask 022
- cd /home/toogley/rpmbuild/BUILD
- cd /home/toogley/rpmbuild/BUILD
- rm -rf Gant-1.9.11
- /usr/bin/gzip -dc /home/toogley/rpmbuild/SOURCES/1.9.11.tar.gz
- /usr/bin/tar -xof -
- STATUS=0
- '[' 0 -ne 0 ']'
- cd Gant-1.9.11
- /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
- /usr/bin/cat /home/toogley/rpmbuild/SOURCES/test.patch
- /usr/bin/patch -s
- find . -name '*.bat' -delete
- find . -name '*.class' -delete
- find . -name '*.jar' -delete
- echo 'Patch #0 (test.patch):'
Patch #0 (test.patch):
- /usr/bin/patch -p0 --fuzz=0
patching file build.gradle Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file build.gradle.rej error: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.RtJaSm (%prep)
_________________[end snippet]________________________-
java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
-- java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
-- java-devel mailing list java-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/java-devel@lists.fedoraproject.o...
java-devel@lists.fedoraproject.org