DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Building updated packages for sun-java6 6u30

Building updated packages for sun-java6 6u30

Tom O'connor user avatar by
Tom O'connor
·
Feb. 05, 12 · Interview
Like (0)
Save
Tweet
Share
7.85K Views

Join the DZone community and get the full member experience.

Join For Free

Recently, Oracle withdrew the ability for Linux distributions to repackage Java and distribute their own packages.  This has been widely regarded as a bad idea.  I tend to agree.

So, let's re-roll an old sun-java6 deb file, with a new content to contain the latest 6u30 java release.

You will need: 

 

  1. 1. A set of build packages (I've got a set for lucid, so if this goes away, I'll find some way to host them.) from http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/
  2. The latest Java packages: http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin and http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin
  3. dch.  just install devscripts package to get this. 
  4.  Some idea of how packaging on debian/ubuntu works.

 

Let's get started.

mkdir package-build
cd package-build
wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26-2lucid1.dsc
wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26-2lucid1.debian.tar.gz
wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26.orig.tar.gz
wget http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin
wget http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin
tom.oconnor@charcoal-black:~/package-build$ ls -1
jdk-6u30-linux-x64.bin
jdk-6u30-linux-i586.bin
sun-java6_6.26-2lucid1.debian.tar.gz
sun-java6_6.26-2lucid1.dsc
sun-java6_6.26.orig.tar.gz
tom.oconnor@charcoal-black:~/package-build$ dpkg-source -x *.dsc
gpgv: Signature made Tue 13 Dec 2011 22:31:53 GMT using RSA key ID CC559573
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./sun-java6_6.26-2lucid1.dsc
dpkg-source: info: extracting sun-java6 in sun-java6-6.26
dpkg-source: info: unpacking sun-java6_6.26.orig.tar.gz
dpkg-source: info: unpacking sun-java6_6.26-2lucid1.debian.tar.gz
tom.oconnor@charcoal-black:~/package-build$ cd sun-java6-6.26/
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ls
debian  jdk-6u26-dlj-linux-amd64.bin  jdk-6u26-dlj-linux-i586.bin
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ rm *.bin
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ../jdk-6u30-linux-i586.bin jdk-6u30-dlj-linux-i586.bin
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ../jdk-6u30-linux-x64.bin jdk-6u30-dlj-linux-amd64.bin
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ vim debian/rules

Head down to the block "# check if the sources are the "same"

Then find and comment the block following it, out, so you get this.

#       : # check if the sources are the "same"
#       set -e; set -- $(all_archs); a1=$$1; shift; \
#       unzip -q -d tmp-$$a1/src $$a1-jdk/src.zip; \
#       for a2; do \
#         unzip -q -d tmp-$$a2/src $$a2-jdk/src.zip; \
#         echo "Comparing sources: tmp-$$a1/src tmp-$$a2/src ..."; \
#         echo "    diff -ur $(diff_ignore)"; \
#         diff -ur $(diff_ignore) tmp-$$a1/src tmp-$$a2/src; \
#       done

Save that file, and then run:

dch -v 6.30

This will create a changelog entry for version 6.30, and open $EDITOR to edit the changelog entry. 

Enter a stub entry.. 

I put something like 

* Updating internal contents to 6u30

.. There's some output, but you can ignore this.

dch warning: New package version is Debian native whilst previous version was not
dch warning: your current directory has been renamed to:
../sun-java6-6.30
dch warning: no orig tarball found for the new version.

 

tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ cd ..
tom.oconnor@charcoal-black:~/package-build$ cd sun-java6-6.30/
tom.oconnor@charcoal-black:~/package-build/sun-java6-6.30$ dpkg-buildpackage -b -uc

... LOTS OF STUFF ...

tom.oconnor@charcoal-black:~/package-build/sun-java6-6.30$ cd ..
tom.oconnor@charcoal-black:~/package-build$ ls
ia32-sun-java6-bin_6.30_amd64.deb     sun-java6_6.26-2lucid1.dsc  sun-java6-6.30                sun-java6-bin_6.30_amd64.deb   sun-java6-fonts_6.30_all.deb   sun-java6-jdk_6.30_amd64.deb  sun-java6-plugin_6.30_amd64.deb
sun-java6_6.26-2lucid1.debian.tar.gz  sun-java6_6.26.orig.tar.gz  sun-java6_6.30_amd64.changes  sun-java6-demo_6.30_amd64.deb  sun-java6-javadb_6.30_all.deb  sun-java6-jre_6.30_all.deb    sun-java6-source_6.30_all.deb

 

Woo. Debs.

What you want to do with them now is up to you.  Next blogpost, I'm going to go over creating a package repository with reprepro.

 

Thanks  to @mibus for his similar article, which this is based partially on.


Source:  http://tomoconnor.eu/blogish/building-updated-packages-sun-java6-6u30/

Java (programming language) Deb (file format) Blocks Changelog Host (Unix) Release (agency) Distribution (differential geometry)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Test Execution Tutorial: A Comprehensive Guide With Examples and Best Practices
  • Java REST API Frameworks
  • Public Key and Private Key Pairs: Know the Technical Difference
  • OpenVPN With Radius and Multi-Factor Authentication

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: