tetra 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.gitignore +27 -0
  2. data/.rubocop.yml +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +28 -0
  5. data/MOTIVATION.md +27 -0
  6. data/README.md +106 -0
  7. data/Rakefile +9 -0
  8. data/SPECIAL_CASES.md +130 -0
  9. data/bin/tetra +29 -0
  10. data/integration-tests/commons.sh +55 -0
  11. data/lib/template/gitignore +2 -0
  12. data/lib/template/kit.spec +64 -0
  13. data/lib/template/kit/CONTENTS +8 -0
  14. data/lib/template/kit/jars/CONTENTS +1 -0
  15. data/lib/template/kit/m2/settings.xml +10 -0
  16. data/lib/template/output/CONTENTS +3 -0
  17. data/lib/template/package.spec +65 -0
  18. data/lib/template/src/CONTENTS +6 -0
  19. data/lib/tetra.rb +63 -0
  20. data/lib/tetra/ant_runner.rb +27 -0
  21. data/lib/tetra/archiver.rb +95 -0
  22. data/lib/tetra/commands/ant.rb +23 -0
  23. data/lib/tetra/commands/base.rb +89 -0
  24. data/lib/tetra/commands/download_maven_source_jars.rb +29 -0
  25. data/lib/tetra/commands/dry_run.rb +17 -0
  26. data/lib/tetra/commands/finish.rb +22 -0
  27. data/lib/tetra/commands/generate_all.rb +38 -0
  28. data/lib/tetra/commands/generate_kit_archive.rb +18 -0
  29. data/lib/tetra/commands/generate_kit_spec.rb +16 -0
  30. data/lib/tetra/commands/generate_package_archive.rb +19 -0
  31. data/lib/tetra/commands/generate_package_script.rb +21 -0
  32. data/lib/tetra/commands/generate_package_spec.rb +22 -0
  33. data/lib/tetra/commands/get_pom.rb +33 -0
  34. data/lib/tetra/commands/get_source.rb +30 -0
  35. data/lib/tetra/commands/init.rb +15 -0
  36. data/lib/tetra/commands/list_kit_missing_sources.rb +21 -0
  37. data/lib/tetra/commands/move_jars_to_kit.rb +18 -0
  38. data/lib/tetra/commands/mvn.rb +23 -0
  39. data/lib/tetra/git.rb +140 -0
  40. data/lib/tetra/kit_checker.rb +104 -0
  41. data/lib/tetra/kit_runner.rb +43 -0
  42. data/lib/tetra/kit_spec_adapter.rb +28 -0
  43. data/lib/tetra/logger.rb +28 -0
  44. data/lib/tetra/main.rb +102 -0
  45. data/lib/tetra/maven_runner.rb +47 -0
  46. data/lib/tetra/maven_website.rb +59 -0
  47. data/lib/tetra/package_spec_adapter.rb +59 -0
  48. data/lib/tetra/pom.rb +55 -0
  49. data/lib/tetra/pom_getter.rb +104 -0
  50. data/lib/tetra/project.rb +245 -0
  51. data/lib/tetra/script_generator.rb +57 -0
  52. data/lib/tetra/source_getter.rb +41 -0
  53. data/lib/tetra/spec_generator.rb +60 -0
  54. data/lib/tetra/template_manager.rb +33 -0
  55. data/lib/tetra/version.rb +6 -0
  56. data/lib/tetra/version_matcher.rb +90 -0
  57. data/spec/data/ant-super-simple-code/build.xml +133 -0
  58. data/spec/data/ant-super-simple-code/build/HW.class +0 -0
  59. data/spec/data/ant-super-simple-code/build/mypackage/HW.class +0 -0
  60. data/spec/data/ant-super-simple-code/dist/antsimple-20130618.jar +0 -0
  61. data/spec/data/ant-super-simple-code/lib/junit-4.11.jar +0 -0
  62. data/spec/data/ant-super-simple-code/lib/log4j-1.2.13.jar +0 -0
  63. data/spec/data/ant-super-simple-code/src/mypackage/HW.java +15 -0
  64. data/spec/data/antlr/antlr-2.7.2.jar +0 -0
  65. data/spec/data/antlr/pom.xml +6 -0
  66. data/spec/data/commons-logging/commons-logging-1.1.1.jar +0 -0
  67. data/spec/data/commons-logging/parent_pom.xml +420 -0
  68. data/spec/data/commons-logging/pom.xml +504 -0
  69. data/spec/data/nailgun/nailgun-0.7.1.jar +0 -0
  70. data/spec/data/nailgun/pom.xml +153 -0
  71. data/spec/data/struts-apps/pom.xml +228 -0
  72. data/spec/data/tomcat/pom.xml +33 -0
  73. data/spec/lib/ant_runner_spec.rb +45 -0
  74. data/spec/lib/archiver_spec.rb +106 -0
  75. data/spec/lib/git_spec.rb +105 -0
  76. data/spec/lib/kit_checker_spec.rb +119 -0
  77. data/spec/lib/maven_runner_spec.rb +68 -0
  78. data/spec/lib/maven_website_spec.rb +56 -0
  79. data/spec/lib/pom_getter_spec.rb +36 -0
  80. data/spec/lib/pom_spec.rb +69 -0
  81. data/spec/lib/project_spec.rb +254 -0
  82. data/spec/lib/script_generator_spec.rb +67 -0
  83. data/spec/lib/source_getter_spec.rb +36 -0
  84. data/spec/lib/spec_generator_spec.rb +130 -0
  85. data/spec/lib/template_manager_spec.rb +54 -0
  86. data/spec/lib/version_matcher_spec.rb +64 -0
  87. data/spec/spec_helper.rb +37 -0
  88. data/spec/support/kit_runner_examples.rb +15 -0
  89. data/tetra.gemspec +31 -0
  90. data/utils/delete_nonet_user.sh +8 -0
  91. data/utils/setup_nonet_user.sh +8 -0
  92. metadata +267 -0
@@ -0,0 +1,27 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # SPEC generated files
16
+ spec/data/nailgun/com.martiansoftware\:nailgun-all\:0.9.1
17
+ spec/data/struts-apps/org.apache.struts\:struts2-apps\:
18
+ spec/data/test-project
19
+
20
+ # YARD artifacts
21
+ .yardoc
22
+ _yardoc
23
+ doc/
24
+
25
+ # integration test files
26
+ integration-tests/galaxy
27
+
@@ -0,0 +1,14 @@
1
+ ClassLength:
2
+ Max: 200
3
+
4
+ LineLength:
5
+ Max: 120
6
+
7
+ MethodLength:
8
+ Max: 35
9
+
10
+ StringLiterals:
11
+ EnforcedStyle: double_quotes
12
+
13
+ MultilineBlockChain:
14
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # See tetra.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2013 SUSE
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above
11
+ copyright notice, this list of conditions and the following disclaimer
12
+ in the documentation and/or other materials provided with the
13
+ distribution.
14
+ * Neither the name of Google Inc. nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,27 @@
1
+ # Motivation
2
+
3
+ The Java developer world has packages (jars, wars, ears...), tools ([ant](http://ant.apache.org/), [Maven](http://maven.apache.org/), [Ivy](http://ant.apache.org/ivy/), [Gradle](http://www.gradle.org/)...) and established workflows to handle software distribution while Linux distros have their own ([zypper](http://en.opensuse.org/Portal:Zypper), [yum](http://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified), [apt](http://en.wikipedia.org/wiki/Advanced_Packaging_Tool)...). Since the two communities have different goals and requirements, Linux distros typically want to repackage Java software with their own format, tools and workflows. Reasons range from ease of installation, predictable rebuildability, support to (security) patching, management tools, legal issues, etc.
4
+
5
+ Unfortunately those two "schemes" became very different over time, so automatic translation/repackaging is not possible except in very simple cases. This leads to a lot of tedious, error-prone manual work that Linux packagers have to do in order to fit the "alien" Java model into distro packaging rules that were thought and optimized with a different ecosystem in mind.
6
+
7
+ A typical example is packaging any software built by Maven on SUSE distros. A number of pain points arise:
8
+
9
+ * Maven requires Internet access and downloads precompiled code as part of the build. RPMs have to be built on a standalone machine in [OBS](http://en.opensuse.org/openSUSE:Build_Service), and they should build code from sources they are provided beforehands exclusively;
10
+ * [Maven is basically a plugin container](http://maven.apache.org/plugins/), so hundreds of different plugins have to be installed to build real-life projects (the exact plugin set and their dependencies is determined at build time). While this is no big deal for Java developers, since they get the corresponding jars prebuilt from public Intenet Maven repositories, it is a nightmare for distros, because all shipping code is supposed to be built from scratch and packaged!
11
+ * Maven often uses multiple versions of a same library or plugin during the same build. Usually distros do not accept more than one version of any given library to reduce maintenance work;
12
+ * Maven requires itself in order to build. To be more exact, Maven needs Nexus, which in turn needs Maven and Nexus. To be more exact, its build dependency graph is a very complicated mess with lots of cycles that have to be broken manually.
13
+
14
+ The current solution in openSUSE is having the packager handle those differences, but this limits the amount of software the community is able to package due to the high effort required to overcome them.
15
+
16
+ The Fedora community is experimenting with another set of tools, [XMvn](http://mizdebsk.fedorapeople.org/xmvn/site/), which goals are similar to `tetra`'s.
17
+
18
+ ## Kit rationale
19
+
20
+ `tetra` simplifies the packaging process mostly because of its use of a binary blob package that contains all build time dependencies for a set of packages called a **kit**.
21
+
22
+ Building software from a binary blob is unusual for Linux distros, and it surely has some drawbacks. It is anyway believed that benefits outweigh them, in fact using prebuilt software:
23
+
24
+ * drastically reduces packaging efforts. A very basic and relatively simple package like [commons-collections](http://commons.apache.org/proper/commons-collections/) needs about [150 jars](https://build.opensuse.org/package/show/home:SilvioMoioli/myproject-kit) just to be compiled and tested. Those should be packaged, roughly, one-by-one!
25
+ * is just the way all Java developers out there build, test and use their software — this is how they expect it to work. Any different approach is necessarily error-prone and could result in unexpected bugs;
26
+ * does not affect the ability of providing patches to Java projects, as only build time requirements are in the kit. In virtually all cases patching a piece of software does not require to patch its build toolchain;
27
+ * does not affect the ability of complying to software licenses like the GPL. In fact those licenses only require to redistribute a project's source code - not the whole toolchain needed to build it. Sources can be added and shipped together with binaries when licenses require it.
@@ -0,0 +1,106 @@
1
+ # tetra – builds RPMs for Java software
2
+
3
+ `tetra` is a set of tools to help you build RPM packages for Java projects.
4
+
5
+ Packaging of Java projects is sometimes hard because build tools like Maven partially overlap with distro tools like RPM in functionality.
6
+
7
+ This tool's goal is to drastically simplifies packaging.
8
+
9
+ ## Installation
10
+
11
+ You need:
12
+
13
+ * [Ruby 1.9](https://www.ruby-lang.org/en/);
14
+ * [git](http://git-scm.com/);
15
+ * a JDK that can compile whatever software you need to package;
16
+
17
+ Install `tetra` via RubyGems:
18
+
19
+ gem install tetra
20
+
21
+ ## Workflow
22
+
23
+ Building a package with `tetra` is quite unusual — this is a deliberate choice, so don't worry. Basic steps are:
24
+
25
+ * `tetra init` a new project;
26
+ * add sources to `src/<package name>` and anything else needed for the build in `kit/` in binary form (typically a copy of Maven and maybe some other dependency jars);
27
+ * execute `tetra dry-run`, then any command needed to compile your software, then `tetra finish`;
28
+ * execute `tetra generate-all`: tetra will look at changed files and Bash history to scaffold spec files and tarballs.
29
+
30
+ Done!
31
+
32
+ ### How can that possibly work?
33
+
34
+ With `tetra` you are not building all dependencies from source, just your package. Everything else is shipped already compiled with attached source files, which is much easier to implement and automate. Yet, it is sufficient to fulfill open source licenses and to have a repeatable, networkless build. See [MOTIVATION.md](MOTIVATION.md) for further information.
35
+
36
+ ## A commons-collections walkthrough
37
+
38
+ First, ceate a new `tetra` project, in this example named "myproject":
39
+
40
+ mkdir myproject
41
+ cd myproject
42
+ tetra init
43
+
44
+ Second, place commons-collections source files in the `src/` folder. Specifically, every `src/` subfolder will become a separate package named after the folder itself, so you can use the following:
45
+
46
+ cd src
47
+ mkdir commons-collections
48
+ cd commons-collections
49
+ wget http://archive.apache.org/dist/commons/collections/source/commons-collections-3.2.1-src.zip
50
+ unzip commons-collections-3.2.1-src.zip
51
+ rm commons-collections-3.2.1-src.zip
52
+
53
+ Third, put all non-source files needed for the build in `kit/`. This means all build dependencies and tools excluding the JDK: in this case it is just Maven:
54
+
55
+ cd ../../kit
56
+ wget http://www.eu.apache.org/dist/maven/binaries/apache-maven-3.1.1-bin.zip
57
+ unzip apache-maven-3.1.1-bin.zip
58
+ rm apache-maven-3.1.1-bin.zip
59
+
60
+ Fourth, you need to show `tetra` how to build your package by running appropriate commands between `tetra dry-run` and `tetra finish`. Bash history will be recorded to generate a "starting-point" build script (that will be sufficient in simple cases like this):
61
+
62
+ cd ../src/commons-collections/commons-collections-3.2.1-src/
63
+ tetra dry-run
64
+ tetra mvn package
65
+ tetra finish
66
+
67
+ Note that we used `tetra mvn package` instead of `mvn package`: this will use of the Maven copy we put in `kit/` and the repository in `kit/m2`.
68
+ Also note that this being a dry-run build, sources will be brought back to their original state after `tetra finish`, as this ensures build repeatability.
69
+
70
+ Finally, generate build scripts, spec files and tarballs in the `output/` directory:
71
+
72
+ tetra generate-all
73
+
74
+ Note that `tetra` will generate files for the commons-collections package and for the binary-only myproject-kit package, which is a special container of all build-time dependencies (basically, the `kit/` folder). This will be shared among all packages you might add to your `tetra` project.
75
+
76
+ ## In-depth information
77
+
78
+ In more complex cases building a package will require some special tweaks. We are trying to cover the most common in the [SPECIAL_CASES.md](SPECIAL_CASES.md) file.
79
+
80
+ An in-depth discussion of this project's motivation is available in the [MOTIVATION.md](MOTIVATION.md) file.
81
+
82
+ ## Status
83
+
84
+ `tetra` is a research project currently in beta state. If you are a packager you can try to use it, any feedback would be **very** welcome!
85
+
86
+ At the moment `tetra` is tested on openSUSE.
87
+
88
+ ## Sources
89
+
90
+ `tetra`'s Git repo is available on GitHub, which can be browsed at:
91
+
92
+ https://github.com/SilvioMoioli/tetra
93
+
94
+ and cloned with:
95
+
96
+ git clone git@github.com:SilvioMoioli/tetra.git
97
+
98
+ ## Contact
99
+
100
+ Are you using `tetra` or even just reading this? Let's get in touch!
101
+
102
+ smoioli at suse dot de
103
+
104
+ ## License
105
+
106
+ MIT license.
@@ -0,0 +1,9 @@
1
+ # encoding: UTF-8
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new
7
+
8
+ task default: :test
9
+ task test: :spec
@@ -0,0 +1,130 @@
1
+ # Special cases
2
+
3
+ ## Failing builds
4
+
5
+ If your build fails for whatever reason, abort it with `tetra finish --abort`. `tetra` will restore all project files as they were before build.
6
+
7
+ ## Manual changes to generated files
8
+
9
+ You can do any manual changes to spec and build.sh files and regenerate them later, `tetra` will reconcile changes with a [three-way merge](http://en.wikipedia.org/wiki/Three-way_merge#Three-way_merge) and alert about any conflicts. You can generate single files with the following commands:
10
+
11
+ * `tetra generate-kit-archive`: (re)generates the kit tarball;
12
+ * `tetra generate-kit-spec`: (re)generates the kit spec;
13
+ * `tetra generate-package-script`: (re)generates the `build.sh` file from the latest bash history (assumes `tetra dry-run` and `tetra finish`have been used). Assumes your current working directory is in a package folder (that is, a subdirectory of `src/<package name>/`);
14
+ * `tetra generate-package-archive`: (re)generates a package tarball;
15
+ * `tetra generate-package-spec`: (re)generates a package spec;
16
+
17
+ Note that, by default, `generate-kit-archive` will generate additional "diff" tar.xz files instead of rewriting the whole archive - this will result in faster uploads if you use OBS (see below). You can use the `--whole` option to regenerate a single complete archive.
18
+
19
+ ## Kit sources
20
+
21
+ Your kit is basically a binary blob. If its sources are needed for proper packaging, for example to comply with the GPL, some extra steps are needed.
22
+
23
+ If you use Maven, most (~90%) sources can be automatically downloaded:
24
+
25
+ tetra download-maven-source-jars
26
+
27
+ The remaining (mostly very outdated) jars will be listed by `tetra` when the download ends. You need to manually find corresponding sources for them, you can use:
28
+
29
+ tetra get-source /path/to/<jar name>.pom
30
+
31
+ to get pointers to relevant sites if available in the pom itself.
32
+
33
+ A list of commonly used jars can be found [below](#frequently-used-sources).
34
+
35
+ You can also use:
36
+
37
+ tetra list-kit-missing-sources
38
+
39
+ To get a list of jars that have one or more `.class` file which does not have a corresponding `.java` file in `kit/` (or zip files in `kit/`).
40
+
41
+ ## Ant builds
42
+
43
+ `tetra` is currently optimized for Maven as it is the most common build tool, but it can work with any other. In particular, support for Ant has already been implemented and `tetra ant` works like `tetra mvn`.
44
+
45
+ Sometimes you will have jar files distributed along with the source archive that will end up in `src/`: you don't want that! Run
46
+
47
+ tetra move-jars-to-kit
48
+
49
+ to have them moved to `kit/jars`. The command will generate a symlink back to the original, so builds will work as expected.
50
+
51
+ When generating spec files, be sure to have a `pom.xml` in your package directory even if you are not using Maven: `tetra` will automatically take advantage of information from it to compile many fields.
52
+
53
+ You can also ask `tetra` to find one via `tetra get-pom <filename>.jar` (be sure to have Maven in your kit).
54
+
55
+ ## Other build tools
56
+
57
+ Other build tools are currently unsupported but will be added in the future. You can nevertheless use them - the only rule is that you have to keep all of their files in `kit`.
58
+
59
+ ## [OBS](build.opensuse.org) integration
60
+
61
+ If you want to submit packages to OBS, you can do so by replacing the `output/` directory in your `tetra` project with a symlink to your OBS project directory.
62
+
63
+ Packages will rebuild cleanly in OBS because no Internet access is needed - all files were already downloaded during dry-run and are included in the kit.
64
+
65
+ Note that the kit package is needed at build time only by OBS, no end user should ever install it.
66
+
67
+
68
+ ## Gotchas
69
+
70
+ * `tetra` internally uses `git` to keep track of files, any tetra project is actually also a `git` repo. Feel free to navigate it, you can commit, push and pull as long as the `tetra` tags are preserved. You can also delete commits and tags, effectively rewinding tetra history (just make sure to delete all tags pointing to a certain commit when you discard it);
71
+ * some Maven plugins like the Eclipse Project ones ([Tycho](https://www.eclipse.org/tycho/)) will save data in `/tmp` downloaded from the Internet and will produce errors if this data is not there during offline builds. One way to work around that is to force Java to use a kit subdirectory as `/tmp`. Add the following option to `tetra mvn` during your build:
72
+
73
+ -DskipTests=true -Djava.io.tmpdir=<full path to project>/kit/tmp
74
+
75
+ Use the following option in `mvn` in your build.sh file to make it reproducible:
76
+
77
+ -DskipTests=true -Djava.io.tmpdir=$PROJECT_PREFIX/kit/tmp
78
+
79
+ * Tycho builds may also require NSS, so if you get NSS errors be sure to add `mozilla-nss` or an equivalent package in a BuildRequires: line;
80
+
81
+ * if you want to be 100% sure your package builds without network access, you can use scripts in the `utils/` folder to create a special `nonet` user that cannot use the Internet and retry the build from that user.
82
+
83
+ ## Frequently used sources
84
+
85
+ * ant-1.8.1: `wget http://archive.apache.org/dist/ant/source/apache-ant-1.8.1-src.tar.gz -O kit/m2/org/apache/ant/ant/1.8.1/ant-1.8.1-sources.tar.gz`;
86
+ * ant-1.8.2: `wget http://archive.apache.org/dist/ant/source/apache-ant-1.8.2-src.tar.gz -O kit/m2/org/apache/ant/ant/1.8.2/ant-1.8.2-sources.tar.gz`;
87
+ * ant-launcher-<version>: sources included in ant-<version>;
88
+ * ant-nodeps-<version>: sources included in ant-<version>;
89
+ * antlr-2.7.7: `wget http://www.antlr2.org/download/antlr-2.7.7.tar.gz -O kit/m2/antlr/antlr/2.7.7/antlr-2.7.7-sources.tar.gz`;
90
+ * asm-3.3.1, asm-commons-3.3.1, asm-tree-3.3.1: `wget http://download.forge.ow2.org/asm/asm-3.3.1.tar.gz -O kit/m2/asm/asm/3.3.1/asm-3.3.1-sources.tar.gz`;
91
+ * aspectjrt-1.5.3: `wget http://git.eclipse.org/c/aspectj/org.aspectj.git/snapshot/org.aspectj-1_5_3_final.tar.gz -O kit/m2/aspectj/aspectjrt/1.5.3/aspectjrt-1.5.3-sources.tar.gz` (you can remove tests, lib, docs and org.eclipse.jdt.core);
92
+ * avalon-framework-4.1.5: `wget http://archive.apache.org/dist/avalon/avalon-framework/v4.1.5/avalon-framework-4.1.5.src.tar.gz -O kit/m2/avalon-framework/avalon-framework/4.1.5//4.1.5--sources.tar.gz`;
93
+ * batik-<subartifact>-1.7: `mkdir kit/m2/org/apache/xmlgraphics/batik/; wget http://archive.apache.org/dist/xmlgraphics/batik/batik-src-1.7.zip -O kit/m2/org/apache/xmlgraphics/batik/batik-sources.zip`
94
+ * bndlib-0.0.238, bndlib-0.0.255: these are used by apache-felix-1.4.x, which is in turn used by commons-parent < 22 to provide JDK 1.4 compatibility. Unfortunately no source before 1.1 is available, if possible update your dependencies to commons-parent >= 22;
95
+ * bsh-2.0b4: `wget http://beanshell2.googlecode.com/files/bsh-2.0b4-src.jar -O kit/m2/org/beanshell/bsh/2.0b4/bsh-2.0b4-sources.zip`;
96
+ * commons-beanutils-core-1.8.0: `wget http://archive.apache.org/dist/commons/beanutils/source/commons-beanutils-1.8.0-src.tar.gz -O kit/m2/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0-sources.tar.gz`;
97
+ * commons-beanutils-core-1.8.3: `wget http://archive.apache.org/dist/commons/beanutils/source/commons-beanutils-1.8.3-src.tar.gz -O kit/m2/commons-beanutils/commons-beanutils-core/1.8.3/commons-beanutils-core-1.8.3-sources.tar.gz`;
98
+ * commons-codec-1.2: `wget http://archive.apache.org/dist/commons/codec/source/commons-codec-1.2-src.tar.gz -O kit/m2/commons-codec/commons-codec/1.2/commons-codec-1.2-sources.tar.gz`;
99
+ * commons-collections-testframework-3.2.1: included in commons-collections-3.2.1;
100
+ * commons-collections-2.0: `wget http://archive.apache.org/dist/commons/collections/source/collections-2.0-src.tar.gz -O kit/m2/commons-collections/commons-collections/2.0/commons-collections-2.0-sources.tar.gz`;
101
+ * commons-jexl-1.1: `wget http://archive.apache.org/dist/commons/jexl/source/commons-jexl-1.1-src.tar.gz -O kit/m2/commons-jexl/commons-jexl/1.1/commons-jexl-1.1-sources.tar.gz`;
102
+ * commons-lang-1.0: `wget http://archive.apache.org/dist/commons/lang/source/lang-1.0-src.tar.gz -O kit/m2/commons-lang/commons-lang/1.0/commons-lang-1.0-sources.tar.gz`;
103
+ * commons-logging-api-1.1: `wget http://archive.apache.org/dist/commons/logging/source/commons-logging-1.1-src.tar.gz -O kit/m2/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.tar.gz` (included in commons-logging-1.1);
104
+ * commons-logging-1.0: `wget http://archive.apache.org/dist/commons/logging/source/logging-1.0-src.tar.gz -O kit/m2/commons-logging/commons-logging/1.0/commons-logging-1.0-sources.tar.gz`;
105
+ * derby-10.9.1.0: `wget http://archive.apache.org/dist/db/derby/db-derby-10.9.1.0/db-derby-10.9.1.0-src.tar.gz -O kit/m2/org/apache/derby/derby/10.9.1.0/derby-10.9.1.0-sources.tar.gz`;
106
+ * dom4j-1.1: `wget http://dom4j.cvs.sourceforge.net/viewvc/dom4j/dom4j/?view=tar\&pathrev=dom4j-1-1 -O kit/m2/dom4j/dom4j/1.1/dom4j-1.1-sources.tar.gz`;
107
+ * doxia-sink-api-1.0-alpha-4: use `svn export http://svn.apache.org/repos/asf/maven/doxia/doxia/tags/doxia-sink-api-1.0-alpha-4/ kit/m2/doxia/doxia-sink-api/1.0-alpha-4/doxia-sink-api-1.0-alpha-4-sources`;
108
+ * fop-0.95: `wget http://archive.apache.org/dist/xmlgraphics/fop/source/fop-0.95-src.tar.gz -O kit/m2/org/apache/xmlgraphics/fop/0.95/fop-0.95-sources.tar.gz`;
109
+ * hc-stylecheck-1: contains only metadata, no sources to be compiled in this artifact;
110
+ * jsr305-1.3.9, jsr305-2.0.1: sources included in jar;
111
+ * jsch-0.1.38: `wget http://sourceforge.net/projects/jsch/files/jsch/0.1.38/jsch-0.1.38.zip/download -O kit/m2/com/jcraft/jsch/0.1.38/jsch-0.1.38-sources.zip`;
112
+ * kxml2-2.2.2: use `wget http://sourceforge.net/projects/kxml/files/kxml2/2.2.2/kxml2-src-2.2.2.zip/download -O kit/m2/net/sf/kxml/kxml2/2.2.2/kxml2-2.2.2-sources.zip`;
113
+ * log4j-1.2.12: `wget http://archive.apache.org/dist/logging/log4j/1.2.12/logging-log4j-1.2.12.tar.gz -O kit/m2/log4j/log4j/1.2.12/log4j-1.2.12-sources.tar.gz`;
114
+ * naming-common-5.0.28, naming-java-5.0.28: `mkdir -p kit/m2/tomcat/tomcat/5.0.28/; wget http://archive.apache.org/dist/tomcat/tomcat-5/v5.0.28/src/jakarta-tomcat-5.0.28-src.tar.gz -O kit/m2/tomcat/tomcat/5.0.28/tomcat-5.0.28-sources.tar.gz` (part of tomcat);
115
+ * org.osgi.core-1.0.0: `wget http://archive.apache.org/dist/felix/org.osgi.core-1.0.0.tar.gz -O kit/m2/org/apache/felix/org.osgi.core/1.0.0/org.osgi.core-1.0.0-sources.tar.gz`;
116
+ * org.osgi.core-4.1.0: sources included in jar;
117
+ * org.osgi.service.obr-1.0.1: `wget http://archive.apache.org/dist/felix/org.osgi.service.obr-1.0.1-project.tar.gz -O kit/m2/org/apache/felix/org.osgi.service.obr/1.0.1/org.osgi.service.obr-1.0.1-sources.tar.gz`;
118
+ * plexus-utils-1.4.9: `wget https://github.com/sonatype/plexus-utils/archive/plexus-utils-1.4.9.tar.gz -O kit/m2/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9-sources.tar.gz`;
119
+ * spymemcached-2.6: `wget http://spymemcached.googlecode.com/files/memcached-2.4.2-sources.zip -O kit/m2/spy/spymemcached/2.6/spymemcached-2.6-sources.zip`;
120
+ * stringtemplate-3.2: `wget http://www.stringtemplate.org/download/stringtemplate-3.2.tar.gz -O kit/m2/org/antlr/stringtemplate/3.2/stringtemplate-3.2-sources.tar.gz`;
121
+ * velocity-tools-2.0: `wget http://archive.apache.org/dist/velocity/tools/2.0/velocity-tools-2.0-src.tar.gz -O kit/m2/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0-sources.tar.gz`;
122
+ * velocity-1.5: `wget http://archive.apache.org/dist/velocity/engine/1.5/velocity-1.5.tar.gz -O kit/m2/org/apache/velocity/velocity/1.5/velocity-1.5-sources.tar.gz`;
123
+ * trilead-ssh2-build213-svnkit-1.3: `svn export http://svn.svnkit.com/repos/svnkit/tags/1.3.5/ kit/m2/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5-sources` (included in svnkit 1.3.5 full sources because of custom patch);
124
+ * xercesImpl-2.9.1: `wget http://archive.apache.org/dist/xerces/j/source/Xerces-J-src.2.9.1.tar.gz -O kit/m2/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1-sources.tar.gz`;
125
+ * xercesMinimal-1.9.6.2: included in any xercesImpl >= 2 source package;
126
+ * xml-apis-ext-1.3.04: `wget http://archive.apache.org/dist/xml/commons/xml-commons-external-1.3.04-src.tar.gz -O kit/m2/xml-apis/xml-apis-ext/1.3.04/xml-apis-ext-1.3.04-sources.tar.gz`;
127
+ * xmlgraphics-commons-1.3.1: `wget http://archive.apache.org/dist/xmlgraphics/commons/source/xmlgraphics-commons-1.3.1-src.tar.gz -O kit/m2/org/apache/xmlgraphics/xmlgraphics-commons/1.3.1/xmlgraphics-commons-1.3.1-sources.tar.gz`;
128
+ * xmlpull-1.1.3.1: `wget http://www.extreme.indiana.edu/xmlpull-website/v1/download/xmlpull_1_1_3_4c_src.tgz -O kit/m2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1-sources.tar.gz`;
129
+ * xpp3-1.1.3.3: `wget http://www.extreme.indiana.edu/dist/java-repository/xpp3/distributions/xpp3-1.1.3.4.C_src.tgz -O kit/m2/xpp3/xpp3/1.1.3.3/xpp3-1.1.3.3-sources.tar.gz`;
130
+ * xmlunit-1.3: `wget http://sourceforge.net/projects/xmlunit/files/xmlunit%20for%20Java/XMLUnit%20for%20Java%201.3/xmlunit-1.3-src.zip/download -O kit/m2/xmlunit/xmlunit/1.3/xmlunit-1.3-sources.zip`;
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # The (open)?SUSE ((Linux Enterprise) (Server|Desktop))?'s
5
+ # packager Swiss Army Knife.
6
+ #
7
+ # Copyright 2013 Silvio Moioli <smoioli@suse.de>
8
+ #
9
+ # Inspired mainly by pom2spec by:
10
+ # Pascal Bleser <pascal.bleser@opensuse.org>
11
+ # Duncan Mac-Vicar Prett <dmacvicar@suse.de>
12
+ #
13
+ # This file is licensed under the
14
+ # GNU Lesser General Public License version 2.1 or later:
15
+ # http://www.gnu.org/licenses/lgpl-2.1.html
16
+ #
17
+
18
+ if File.exist?(File.join(File.dirname(__FILE__), "..", ".git"))
19
+ $LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")
20
+ end
21
+
22
+ begin
23
+ require "tetra"
24
+ rescue LoadError
25
+ require "rubygems"
26
+ require "tetra"
27
+ end
28
+
29
+ Tetra::MainCommand.run
@@ -0,0 +1,55 @@
1
+ #!/bin/bash
2
+
3
+ # A crude integration test that builds commons-collections
4
+
5
+ set -e
6
+
7
+ rm -Rf galaxy
8
+ mkdir galaxy
9
+ cd galaxy
10
+ tetra init
11
+
12
+ cd src
13
+ mkdir commons-collections
14
+ cd commons-collections
15
+ wget http://archive.apache.org/dist/commons/collections/source/commons-collections-3.2.1-src.zip
16
+ unzip commons-collections-3.2.1-src.zip
17
+ rm commons-collections-3.2.1-src.zip
18
+
19
+ cd ../../kit
20
+ wget http://apache.fastbull.org/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.zip
21
+ unzip apache-maven-*.zip
22
+ rm apache-maven-*.zip
23
+ cd ..
24
+
25
+ tetra dry-run --very-very-verbose
26
+ cd src/commons-collections/commons-collections-3.2.1-src/
27
+ tetra mvn package -DskipTests
28
+ tetra finish
29
+
30
+ tetra generate-all
31
+ cd ../../..
32
+
33
+ cd src
34
+ mkdir commons-fileupload
35
+ cd commons-fileupload
36
+ wget http://archive.apache.org/dist/commons/fileupload/source/commons-fileupload-1.3-src.zip
37
+ unzip commons-fileupload-1.3-src.zip
38
+ rm commons-fileupload-1.3-src.zip
39
+
40
+ tetra dry-run
41
+ cd commons-fileupload-1.3-src/
42
+ tetra mvn package -DskipTests
43
+ tetra finish
44
+
45
+ tetra generate-kit-archive
46
+ tetra generate-kit-spec
47
+ tetra generate-package-script
48
+ tetra generate-package-archive
49
+ tetra generate-package-spec
50
+ cd ../../..
51
+
52
+
53
+ echo "**************** All Done ****************"
54
+
55
+ ls -lah output/*
@@ -0,0 +1,2 @@
1
+ *.tetra_user_edited
2
+ output/
@@ -0,0 +1,64 @@
1
+ #
2
+ # spec file for tetra kit for project "<%= name %>"
3
+ #
4
+ # Copyright (c) <%= Time.now.year %> <%= Etc.getlogin %>
5
+ #
6
+ # All modifications and additions to the file contributed by third parties
7
+ # remain the property of their copyright owners, unless otherwise agreed
8
+ # upon. The license for this file, and modifications and additions to the
9
+ # file, is the same license as for the pristine package itself (unless the
10
+ # license for the pristine package is not an Open Source License, in which
11
+ # case the license is the MIT License). An "Open Source License" is a
12
+ # license that conforms to the Open Source Definition (Version 1.9)
13
+ # published by the Open Source Initiative.
14
+
15
+ # Please submit bugfixes or comments via http://bugs.opensuse.org/
16
+ #
17
+
18
+ Name: <%= name %>-kit
19
+ Version: <%= version %>
20
+ Release: 1
21
+ License: Apache-2.0
22
+ Summary: Build-time dependencies for tetra project <%= name %>
23
+ Url: https://github.com/SilvioMoioli/tetra
24
+ Group: Development/Libraries/Java
25
+ <% archives.each_with_index do |archive, i| %>
26
+ Source<%= i %>: <%= archive %>
27
+ <% end %>
28
+ BuildRoot: %{_tmppath}/%{name}-%{version}-build
29
+ BuildArch: noarch
30
+ BuildRequires: xz
31
+ BuildRequires: fdupes
32
+ Provides: tetra(kit)
33
+ # no two kits should ever be installed at any given time
34
+ Conflicts: otherproviders(tetra(kit))
35
+
36
+ %description
37
+ This package has been automatically created by tetra in order to
38
+ satisfy build time dependencies of some Java packages. It should
39
+ not be used except for rebuilding those packages and it should never
40
+ be installed on end users' systems.
41
+
42
+ %prep
43
+ <% (0..(archives.length-1)).each do |i| %>
44
+ <% if i > 0 %>
45
+ %setup -q -c -T -D -b <%= i %>
46
+ <% else %>
47
+ %setup -q -c -T -b <%= i %>
48
+ <% end %>
49
+ <% end %>
50
+
51
+ %build
52
+ # nothing to do, tetra kits are precompiled by design
53
+
54
+ %install
55
+ export NO_BRP_CHECK_BYTECODE_VERSION=true
56
+ install -d -m 0755 %{buildroot}%{_datadir}/tetra/%{name}/
57
+ cp -a * %{buildroot}%{_datadir}/tetra/%{name}/
58
+ %fdupes -s %{buildroot}%{_datadir}/tetra/%{name}/
59
+
60
+ %files
61
+ %defattr(-,root,root)
62
+ %{_datadir}/tetra/
63
+
64
+ %changelog