]>
Commit | Line | Data |
---|---|---|
6195839e | 1 | # TODO: |
2 | # - pldize examples | |
d44d83a7 | 3 | %include /usr/lib/rpm/macros.java |
4 | Summary: Ant task for yuicompressor | |
5 | Summary(pl.UTF-8): Wtyczka programu ant do yuicompressor | |
6 | Name: ant-yuicompressor | |
7 | Version: 0.5 | |
8 | Release: 1 | |
9 | License: BSD | |
10 | Group: Development/Languages/Java | |
11 | Source0: http://github.com/n0ha/yui-compressor-ant-task/tarball/yui-compressor-ant-task-0.5/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: 895d08ada70ec00d48b9b008a1054a8f | |
b9526121 | 13 | Source1: antlib.xml |
d44d83a7 | 14 | URL: http://github.com/n0ha/yui-compressor-ant-task/ |
15 | BuildRequires: ant | |
16 | BuildRequires: jdk | |
17 | BuildRequires: jpackage-utils | |
18 | BuildRequires: rpm-javaprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.555 | |
68a63e3f | 20 | BuildRequires: sed >= 4.0 |
d44d83a7 | 21 | Requires: jpackage-utils |
22 | BuildArch: noarch | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | Ant task for yuicompressor. | |
27 | ||
28 | %description -l pl.UTF-8 | |
29 | Wtyczka programu ant do yuicompressor. | |
30 | ||
31 | %package javadoc | |
32 | Summary: Online manual for %{name} | |
33 | Summary(pl.UTF-8): Dokumentacja online do %{name} | |
34 | Group: Documentation | |
35 | Requires: jpackage-utils | |
36 | ||
37 | %description javadoc | |
38 | Documentation for %{name}. | |
39 | ||
40 | %description javadoc -l pl.UTF-8 | |
41 | Dokumentacja do %{name}. | |
42 | ||
43 | %description javadoc -l fr.UTF-8 | |
44 | Javadoc pour %{name}. | |
45 | ||
46 | %package examples | |
47 | Summary: Examples for %{name} | |
48 | Summary(pl.UTF-8): Przykłady użycia %{name} | |
49 | Group: Documentation | |
50 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
51 | ||
52 | %description examples | |
53 | Examples for %{name}. | |
54 | ||
55 | %description examples -l pl.UTF-8 | |
56 | Przykłady dla pakietu %{name}. | |
57 | ||
58 | %package source | |
59 | Summary: Source code of %{name} | |
60 | Summary(pl.UTF-8): Kod źródłowy %{name} | |
61 | Group: Documentation | |
62 | Requires: jpackage-utils >= 1.7.5-2 | |
63 | ||
64 | %description source | |
65 | Source code of %{name}. | |
66 | ||
67 | %description source -l pl.UTF-8 | |
68 | Kod źródłowy %{name}. | |
69 | ||
70 | %prep | |
71 | %setup -qc | |
72 | mv n0ha-*/* . | |
82675d34 | 73 | %undos build.xml doc/example/build.xml |
d44d83a7 | 74 | |
25289c4c | 75 | # name of second jar can not be substring of first jar. This part of code is |
76 | # from /usr/bin/jar: | |
77 | # for dep in `cat "$file"`; do | |
78 | # case "$OPT_JAR_LIST" in | |
79 | # *"$dep"*) ;; | |
80 | # *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep" | |
81 | # esac | |
82 | # done | |
83 | # so if second name is contained in first it will be skipped. | |
84 | echo "yuicompressor ant/ant-yuicompressor" > ant.conf | |
85 | ||
d44d83a7 | 86 | echo >> doc/CHANGELOG |
87 | echo >> doc/LICENSE | |
88 | ||
89 | find -name '*jar' | xargs rm | |
90 | ||
91 | %build | |
92 | export JAVA_HOME="%{java_home}" | |
93 | ||
94 | required_jars="yuicompressor" | |
95 | CLASSPATH=$(build-classpath $required_jars) | |
96 | ||
97 | %ant jar javadocs \ | |
98 | -Dbuild.sysclasspath=first | |
99 | ||
b9526121 | 100 | install -d net/noha/tools/ant/yuicompressor/tasks/ |
101 | cp -a %{SOURCE1} net/noha/tools/ant/yuicompressor/tasks/antlib.xml | |
102 | %{jar} uf build/bin/yui-compressor-ant-task-%{version}.jar net/noha/tools/ant/yuicompressor/tasks/antlib.xml | |
103 | ||
d44d83a7 | 104 | %{jar} cf %{name}.src.jar -C src . |
105 | ||
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | # ant task | |
110 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ant.d,%{_javadir}/ant} | |
b9526121 | 111 | cp -a build/bin/yui-compressor-ant-task-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/ant/%{name}-%{version}.jar |
d44d83a7 | 112 | ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/ant/%{name}.jar |
113 | cp -a ant.conf $RPM_BUILD_ROOT%{_sysconfdir}/ant.d/yuicompressor | |
114 | ||
115 | # javadoc | |
116 | install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} | |
117 | cp -a build/doc/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} | |
118 | ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink | |
119 | ||
120 | # examples | |
121 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
122 | cp -a doc/example $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
123 | ||
124 | # source | |
125 | install -d $RPM_BUILD_ROOT%{_javasrcdir} | |
126 | cp -a %{name}.src.jar $RPM_BUILD_ROOT%{_javasrcdir}/%{name}.src.jar | |
127 | ||
128 | %clean | |
129 | rm -rf $RPM_BUILD_ROOT | |
130 | ||
131 | %post javadoc | |
132 | ln -nfs %{name}-%{version} %{_javadocdir}/%{name} | |
133 | ||
134 | %files | |
135 | %defattr(644,root,root,755) | |
136 | %doc README doc/CHANGELOG doc/LICENSE | |
137 | %{_sysconfdir}/ant.d/yuicompressor | |
138 | %{_javadir}/ant/%{name}.jar | |
139 | %{_javadir}/ant/%{name}-%{version}.jar | |
140 | ||
141 | %files examples | |
142 | %defattr(644,root,root,755) | |
143 | %{_examplesdir}/%{name}-%{version} | |
144 | ||
145 | %files javadoc | |
146 | %defattr(644,root,root,755) | |
147 | %{_javadocdir}/%{name}-%{version} | |
148 | %ghost %{_javadocdir}/%{name} | |
149 | ||
150 | %files source | |
151 | %defattr(644,root,root,755) | |
152 | %{_javasrcdir}/%{name}.src.jar |