FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add example collection depending on common java collection · fedora-java/example-java1@dfcb560 · GitHub

Commit dfcb560

Browse files
committed
Add example collection depending on common java collection
0 parents  commit dfcb560

7 files changed

Lines changed: 226 additions & 0 deletions

File tree

‎example-java1/example-java1.spec‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
%global scl_name_prefix example-
2+
%global scl_name_base java
3+
%global scl_name_version 1
4+
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
5+
%scl_package %scl
6+
7+
Summary: Package that installs %scl
8+
Name: %scl_name
9+
Version: 1
10+
Release: 1%{?dist}
11+
License: GPLv2+
12+
13+
BuildRequires: scl-utils-build
14+
BuildRequires: %{?scl_prefix_java_common}scldevel
15+
16+
%description
17+
This is the main package for %scl Software Collection.
18+
19+
%package runtime
20+
Summary: Runtime scripts for the %scl Software Collection
21+
Requires: scl-utils
22+
Requires: %{?scl_prefix_java_common}runtime
23+
24+
%description runtime
25+
Package shipping essential scripts to work with the %scl Software
26+
Collection.
27+
28+
%package build
29+
Summary: Build configuration for the %scl Software Collection
30+
Requires: scl-utils-build
31+
Requires: %{name}-scldevel = %{version}-%{release}
32+
33+
%description build
34+
Package shipping essential configuration macros to build the %scl
35+
Software Collection itself.
36+
37+
%package scldevel
38+
Summary: Development files for the %scl Software Collection
39+
Requires: %{name}-runtime = %{version}-%{release}
40+
Requires: %{?scl_prefix_java_common}scldevel
41+
42+
%description scldevel
43+
Package shipping development files, especially useful for development of
44+
packages depending on the %scl Software Collection.
45+
46+
%prep
47+
%setup -c -T
48+
49+
%build
50+
# Enable collection script
51+
# ========================
52+
cat <<EOF >enable
53+
#!/bin/bash
54+
export PATH="%{_bindir}:\${PATH:-/bin:/usr/bin}"
55+
export MANPATH="%{_mandir}:\${MANPATH}"
56+
export JAVACONFDIRS="%{_sysconfdir}/java\${JAVACONFDIRS:+:}\${JAVACONFDIRS:-}"
57+
export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}"
58+
export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
59+
EOF
60+
61+
# SCL devel macros
62+
# ================
63+
cat <<EOF >macros.%{scl}-scldevel
64+
%%scl_%{scl_name_base} %{scl}
65+
%%scl_prefix_%{scl_name_base} %{scl_prefix}
66+
EOF
67+
68+
%install
69+
%{scl_install}
70+
%{scl_install_java}
71+
72+
install -p -m 644 macros.%{scl}-scldevel %{buildroot}%{_root_sysconfdir}/rpm/
73+
74+
# Install scl scripts
75+
install -d -m 755 %{buildroot}%{_scl_scripts}
76+
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
77+
78+
%files
79+
80+
%files runtime -f .java-filelist
81+
%{scl_files}
82+
83+
%files build
84+
%{_root_sysconfdir}/rpm/macros.%{scl}-config
85+
86+
%files scldevel
87+
%{_root_sysconfdir}/rpm/macros.%{scl}-scldevel
88+
89+
%changelog
90+
* Thu May 18 2017 Michael Simacek <msimacek@redhat.com> - 1-1
91+
- Initial version

‎maven-bar/Main.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.fedoraproject.example;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Foo bar = new Foo();
6+
bar.doStuff();
7+
}
8+
}

‎maven-bar/maven-bar.spec‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
%{?scl:%scl_package maven-bar}
2+
%{!?scl:%global pkg_name %{name}}
3+
4+
Name: %{?scl_prefix}maven-bar
5+
Version: 1.0.0
6+
Release: 1%{?dist}
7+
Summary: Example maven project
8+
License: BSD
9+
Source0: pom.xml
10+
Source1: Main.java
11+
BuildArch: noarch
12+
13+
BuildRequires: %{?scl_prefix_java_common}maven-local
14+
BuildRequires: %{?scl_prefix}mvn(org.fedoraproject.example:maven-foo)
15+
16+
%description
17+
%{summary}.
18+
19+
%prep
20+
%setup -q -T -c %{pkg_name}
21+
22+
cp -p %{SOURCE0} pom.xml
23+
mkdir -p src/main/java/org/fedoraproject/example
24+
cp -p %{SOURCE1} src/main/java/org/fedoraproject/example/
25+
26+
%build
27+
%mvn_build -j
28+
29+
30+
%install
31+
%mvn_install
32+
33+
# jpackage_script doesn't work in dependent scls, because it's used from base rhel
34+
#%%jpackage_script org.fedoraproject.example.Main '' '' maven-foo:slf4j/slf4j-api:slf4j/slf4j-simple example 1
35+
36+
%files -f .mfiles
37+
#%%{_bindir}/example
38+
39+
%changelog
40+
* Fri May 19 2017 Michael Simacek <msimacek@redhat.com> - 1.0.0-1
41+
- Initial version

‎maven-bar/pom.xml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.fedoraproject.example</groupId>
6+
<artifactId>maven-bar</artifactId>
7+
<version>1.0.0</version>
8+
<dependencies>
9+
<dependency>
10+
<groupId>org.fedoraproject.example</groupId>
11+
<artifactId>maven-foo</artifactId>
12+
<version>1.0.0</version>
13+
</dependency>
14+
</dependencies>
15+
</project>

‎maven-foo/Foo.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.fedoraproject.example;
2+
3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
6+
public class Foo {
7+
Logger logger = LoggerFactory.getLogger(Foo.class);
8+
9+
public void doStuff() {
10+
logger.info("Doing stuff");
11+
}
12+
}

‎maven-foo/maven-foo.spec‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
%{?scl:%scl_package maven-foo}
2+
%{!?scl:%global pkg_name %{name}}
3+
4+
Name: %{?scl_prefix}maven-foo
5+
Version: 1.0.0
6+
Release: 1%{?dist}
7+
Summary: Example maven project
8+
License: BSD
9+
Source0: pom.xml
10+
Source1: Foo.java
11+
BuildArch: noarch
12+
13+
BuildRequires: %{?scl_prefix_java_common}maven-local
14+
BuildRequires: %{?scl_prefix_java_common}mvn(org.slf4j:slf4j-api)
15+
BuildRequires: %{?scl_prefix_java_common}mvn(org.slf4j:slf4j-simple)
16+
17+
%description
18+
%{summary}.
19+
20+
%prep
21+
%setup -q -T -c %{pkg_name}
22+
23+
cp -p %{SOURCE0} pom.xml
24+
mkdir -p src/main/java/org/fedoraproject/example
25+
cp -p %{SOURCE1} src/main/java/org/fedoraproject/example/
26+
27+
%build
28+
%mvn_build -j
29+
30+
31+
%install
32+
%mvn_install
33+
34+
%files -f .mfiles
35+
36+
%changelog
37+
* Fri May 19 2017 Michael Simacek <msimacek@redhat.com> - 1.0.0-1
38+
- Initial version

‎maven-foo/pom.xml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.fedoraproject.example</groupId>
6+
<artifactId>maven-foo</artifactId>
7+
<version>1.0.0</version>
8+
<dependencies>
9+
<dependency>
10+
<groupId>org.slf4j</groupId>
11+
<artifactId>slf4j-api</artifactId>
12+
<version>1.7.25</version>
13+
</dependency>
14+
<dependency>
15+
<groupId>org.slf4j</groupId>
16+
<artifactId>slf4j-simple</artifactId>
17+
<version>1.7.25</version>
18+
<scope>runtime</scope>
19+
</dependency>
20+
</dependencies>
21+
</project>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL