1 # Spec file only supports RHEL and Fedora now
2 %if 0%{?rhel} || 0%{?fedora}
4 Name: opendaylight-yangtools
7 Summary: OpenDaylight yangtools
8 Group: Applications/Communications
10 URL: http://www.opendaylight.org
12 # todo: Temporary method for generating tarball
13 # git clone https://git.opendaylight.org/gerrit/p/yangtools.git
15 # git archive --prefix=opendaylight-yangtools-0.1.0/ HEAD | xz > opendaylight-yangtools-0.1.0.tar.xz
16 Source0: %{name}-%{version}.tar.xz
20 BuildRequires: java-devel
22 Requires: java >= 1:1.7.0
24 # This is the directory where all the application resources (scripts,
25 # libraries, etc) will be installed: /usr/share/opendaylight
26 %global resources_dir %{_datadir}/opendaylight-controller
28 # This is the directory that has all the JAVA dependencies.
29 %global deps_dir %{_javadir}/opendaylight-controller-dependencies
33 YANG Tools is a infrastructure project aiming to develop necessary
34 tooling and libraries providing support of NETCONF and YANG for Java
35 (JVM-language based) projects and applications, such as Model Driven
36 SAL for Controller (which uses YANG as it's modeling language) and
37 Netconf / OFConfig plugins.
47 # This regular maven build will need to be replaced by the distribution
48 # specific maven build command, but this is ok for now:
49 # todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
51 # Don't do the tests since those are already covered by the normal merge and
52 # verify process and this build does not need to verify them.
53 # maven.compile.fork is used to reduce the build time.
54 #export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
55 # mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
56 export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
61 # Create the directories:
62 install -d -m 755 %{buildroot}%{resources_dir}/plugins
64 while read artifact; do
65 src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
66 if [ -f "${src}" ]; then
67 tgt=$(basename ${src})
68 install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.${tgt}
71 binding-generator-api-*.jar
72 binding-generator-impl-*.jar
73 binding-generator-spi-*.jar
74 binding-generator-util-*.jar
75 binding-model-api-*.jar
76 binding-type-provider-*.jar
86 yang-parser-impl-*.jar
89 # These next two loops have chairs that need a model prefix.
90 # But first take care of these topology jars. Notice there is another topology jar
91 # in the loop after this one, but its pattern matches all the topology jars and
92 # causes the -f to fail so break the loops apart. Some master regex god can
93 # probably combine the loops with magic.
94 while read base artifact; do
95 src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
96 if [ -f "${src}" ]; then
97 tgt=$(basename ${src})
98 install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.model.${tgt}
102 model ietf-topology-isis-*.jar
103 model ietf-topology-l3-unicast-igp-*.jar
104 model ietf-topology-ospf-*.jar
107 while read base artifact; do
108 src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
109 if [ -f "${src}" ]; then
110 tgt=$(basename ${src})
111 install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.model.${tgt}
114 model ietf-inet-types-*.jar
116 model ietf-topology-*.jar
117 model ietf-yang-types-*.jar
118 model opendaylight-l2-types-*.jar
122 # Remove the temporary directory:
127 %if "%{noclean}" == "1"
140 * Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0