File proguard.spec of Package proguard

#
# spec file for package proguard
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           proguard
Summary:        Java class file shrinker, optimizer, obfuscator, and preverifier
License:        GPL-2.0
Version:        6.0.3
Release:        1
Url:            http://proguard.sourceforge.net/
Group:          Development/Languages/Java
Source0:        %{name}%{version}.tar.gz
Source1:        %{name}.manifest
Source2:        %{name}gui.manifest
Source3:        %{name}.sh
Source4:        %{name}gui.sh
Requires:       jre >= 1.7
BuildRequires:  java-devel
BuildRequires:  jpackage-utils
PreReq:         jpackage-utils
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ProGuard is a free Java class file shrinker, optimizer, obfuscator,
   and preverifier. It detects and removes unused classes, fields,
   methods, and attributes. It optimizes bytecode and removes unused
   instructions. It renames the remaining classes, fields, and
   methods using short meaningless names. Finally, it preverifies
   the processed code for Java 6 or for Java Micro Edition.  Some
   uses of ProGuard are: - Creating more compact code, for smaller
   code archives, faster transfer across networks, faster loading,
   and smaller memory footprints.

- Making programs and libraries harder to reverse-engineer.

- Listing dead code, so it can be removed from the source code.

- Retargeting and preverifying existing class files for Java 6, to
   take full advantage of Java 6's faster class loading.

- ProGuard's main advantage compared to other Java obfuscators is
   probably its compact template-based configuration. A few
   intuitive command line options or a simple configuration file are
   usually sufficient. For instance, the following configuration
   option preserves all applets in a jar: -keep public class *
   extends java.applet.Applet

The user manual explains all available options and shows more examples
of this powerful configuration style.  ProGuard is fast. It only takes
seconds to process programs and libraries of several megabytes. The
results section presents actual figures for a number of applications. 
ProGuard is a command-line tool with an optional graphical user
interface.



%package gui
License:        GPL-2.0
Summary:        Java class file shrinker, optimizer, obfuscator, and preverifier
Group:          Development/Languages/Java
Requires:       %{name} = %{version}

%description gui
ProGuard is a free Java class file shrinker, optimizer, obfuscator,
   and preverifier. It detects and removes unused classes, fields,
   methods, and attributes. It optimizes bytecode and removes unused
   instructions. It renames the remaining classes, fields, and
   methods using short meaningless names. Finally, it preverifies
   the processed code for Java 6 or for Java Micro Edition.  Some
   uses of ProGuard are: - Creating more compact code, for smaller
   code archives, faster transfer across networks, faster loading,
   and smaller memory footprints.

- Making programs and libraries harder to reverse-engineer.

- Listing dead code, so it can be removed from the source code.

- Retargeting and preverifying existing class files for Java 6, to
   take full advantage of Java 6's faster class loading.

- ProGuard's main advantage compared to other Java obfuscators is
   probably its compact template-based configuration. A few
   intuitive command line options or a simple configuration file are
   usually sufficient. For instance, the following configuration
   option preserves all applets in a jar: -keep public class *
   extends java.applet.Applet

The user manual explains all available options and shows more examples
of this powerful configuration style.  ProGuard is fast. It only takes
seconds to process programs and libraries of several megabytes. The
results section presents actual figures for a number of applications. 
ProGuard is a command-line tool with an optional graphical user
interface.



%package doc
License:        GPL-2.0
Summary:        Java class file shrinker, optimizer, obfuscator, and preverifier
Group:          Development/Languages/Java

%description doc
ProGuard is a free Java class file shrinker, optimizer, obfuscator,
   and preverifier. It detects and removes unused classes, fields,
   methods, and attributes. It optimizes bytecode and removes unused
   instructions. It renames the remaining classes, fields, and
   methods using short meaningless names. Finally, it preverifies
   the processed code for Java 6 or for Java Micro Edition.  Some
   uses of ProGuard are: - Creating more compact code, for smaller
   code archives, faster transfer across networks, faster loading,
   and smaller memory footprints.

- Making programs and libraries harder to reverse-engineer.

- Listing dead code, so it can be removed from the source code.

- Retargeting and preverifying existing class files for Java 6, to
   take full advantage of Java 6's faster class loading.

- ProGuard's main advantage compared to other Java obfuscators is
   probably its compact template-based configuration. A few
   intuitive command line options or a simple configuration file are
   usually sufficient. For instance, the following configuration
   option preserves all applets in a jar: -keep public class *
   extends java.applet.Applet

The user manual explains all available options and shows more examples
of this powerful configuration style.  ProGuard is fast. It only takes
seconds to process programs and libraries of several megabytes. The
results section presents actual figures for a number of applications. 
ProGuard is a command-line tool with an optional graphical user
interface.



%package javadoc
License:        GPL-2.0
Summary:        Java class file shrinker, optimizer, obfuscator, and preverifier
Group:          Development/Languages/Java

%description javadoc
ProGuard is a free Java class file shrinker, optimizer, obfuscator,
   and preverifier. It detects and removes unused classes, fields,
   methods, and attributes. It optimizes bytecode and removes unused
   instructions. It renames the remaining classes, fields, and
   methods using short meaningless names. Finally, it preverifies
   the processed code for Java 6 or for Java Micro Edition.  Some
   uses of ProGuard are: - Creating more compact code, for smaller
   code archives, faster transfer across networks, faster loading,
   and smaller memory footprints.

- Making programs and libraries harder to reverse-engineer.

- Listing dead code, so it can be removed from the source code.

- Retargeting and preverifying existing class files for Java 6, to
   take full advantage of Java 6's faster class loading.

- ProGuard's main advantage compared to other Java obfuscators is
   probably its compact template-based configuration. A few
   intuitive command line options or a simple configuration file are
   usually sufficient. For instance, the following configuration
   option preserves all applets in a jar: -keep public class *
   extends java.applet.Applet

The user manual explains all available options and shows more examples
of this powerful configuration style.  ProGuard is fast. It only takes
seconds to process programs and libraries of several megabytes. The
results section presents actual figures for a number of applications. 
ProGuard is a command-line tool with an optional graphical user
interface.



%prep
%setup -q -n %{name}%{version}
cp -a %{SOURCE1} %{SOURCE2} .
rm lib/*.jar

%build
./core/build.sh
./retrace/build.sh
./gui/build.sh
#javadoc
mkdir javadoc
javadoc -d javadoc -sourcepath core/src -classpath $(build-classpath ant) -subpackages proguard

%install
#jars
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 lib/*.jar %{buildroot}%{_javadir}
#jars
install -d -m 755 %{buildroot}%{_bindir}
install -m 755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}
install -m 755 %{SOURCE4} %{buildroot}%{_bindir}/%{name}gui
(cd %{buildroot}%{_javadir} && for jar in *.jar; do mv ${jar} `echo $jar| sed  "s|.jar|-%{version}.jar|g"`; done)
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
#doc
install -d -m 755 %{buildroot}%{_defaultdocdir}/%{name}-%{version}
find docs/ examples -type 'f' | xargs chmod a-x
cp -ar docs/* examples %{buildroot}%{_defaultdocdir}/%{name}-%{version}/
#javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -ar javadoc/* %{buildroot}%{_defaultdocdir}/%{name}-%{version}/

%files
%defattr(-,root,root)
%doc README
%{_bindir}/%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/retrace.jar
%{_javadir}/retrace-%{version}.jar

%files gui
%defattr(-,root,root)
%doc README
%{_bindir}/%{name}gui
%{_javadir}/%{name}gui.jar
%{_javadir}/%{name}gui-%{version}.jar

%files doc
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}-%{version}

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{name}-%{version}

%changelog