Difference between revisions of "Deploying Your Application"

From Lazarus wiki
Jump to navigationJump to search
(scary thing, this rm -rf)
Line 36: Line 36:
  
 
%install
 
%install
 +
rm -rf $RPM_BUILD_ROOT
 
mkdir -p $RPM_BUILD_ROOT/usr/share/magnifier
 
mkdir -p $RPM_BUILD_ROOT/usr/share/magnifier
 
mkdir -p $RPM_BUILD_ROOT/usr/bin
 
mkdir -p $RPM_BUILD_ROOT/usr/bin

Revision as of 20:33, 2 May 2006

English (en) español (es) français (fr) português (pt)

Using InnoSetup on Windows

[Brief overview needed]

Creating an RPM on Linux

On Linux, the best way to deploy a application is using the native package system. Of those, the RPM (RPM Package Manager) is the most commonly used format, and is defined as a standard on the Linux Standard Base.

To create a RPM file, you need to create a spec text file will all information necessary to build the package, and also a environment to build that spec. The best editor to create RPM packages is Emacs, because it recognizes the spec extension, highlights the text appropriately and even has a menu option to build rpm packages.

Example RPM Spec file:

Name:           magnifier
Version:        3.2
Release:        1
Summary:        Virtual Magnifying Glass
Group:          Accessibility
License:        GPL Version 2
URL:            magnifier.sourceforge.net
Source0:        http://internap.dl.sourceforge.net/sourceforge/magnifier/magnifier-3.2.zip
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  fpc >= 2.0.2, lazarus >= 0.9.12
Requires:       ImageMagick

%description

Virtual Magnifying Glass is a free, open source, multiplatform, screen magnification tool. It is simple, customizable, and easy-to-use.

%prep
%setup -q magnifier

%build
fpc -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/components/opengl/gtk2x11/ -Fu/usr/lib/lazarus/components/opengl/gtk2x11/include/ -Fu/usr/lib/lazarus/components/jpeg/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share/magnifier
mkdir -p $RPM_BUILD_ROOT/usr/bin
cp -a $RPM_BUILD_DIR/magnifier-3.2/ $RPM_BUILD_ROOT/usr/share/magnifier/
ln -fs $RPM_BUILD_ROOT/usr/share/magnifier/magnifier $RPM_BUILD_ROOT/usr/bin/magnifier

%clean
rm -rf $RPM_BUILD_ROOT/

%files
%defattr(-,root,root,-)
/usr/share/magnifier/
/usr/bin/magnifier

%changelog

* Wed Feb 15 2006 Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> - 3.2-mdk.i386.rpm
- The Linux RPM package is created.

Using PackageMaker on OS X

Most OS X programs are distributed as a disk image file (.dmg extension). Normally you download or copy a program's .dmg file to your Mac and double-click it. This "mounts" the disk image and opens it in a window on the desktop, where you'll typically see a package file (.pkg extension) that you double-click to perform the actual program installation. After installation is complete, you "unmount" (eject) the mounted disk image by dragging it to the trash. You can also delete the .dmg file by dragging it to the trash as well.

The installer .pkg file is actually a directory, as is the resulting application bundle (.app extension) that it copies to the Applications folder. To the user, .pkg and .app files look and act like ordinary files, but they're really directories whose details have been hidden from the user. You can see what's inside a .pkg or .app file by entering normal cd commands in a terminal window (for example, cd progname.app) or by Ctrl-clicking the file and choosing Show Package Contents from the popup menu.

You create .pkg files using PackageMaker, which is installed along with the XCode tools in /Developer/Applications/Utilities. With PackageMaker, you select the folder containing the files you want to package and set other installation options, for example whether a password must be entered to install the program. Note that the folder you select can be an .app file. Choose File | Create Package to create the .pkg file. You can also save your settings for future use in PackageMaker by choosing File | Save to create a .pmsp file that you name.

To create a .dmg file, run the OS X Disk Utility, which is installed in /Applications/ Utilities. Select Images | New | Image from Folder and choose the folder containing your .pkg file and any other files you want to include in the disk image. In the Convert Image dialog, enter the name of the .dmg file to create, select where it should be saved, and select "compressed" as the image format. The .dmg file that Disk Utility creates is then ready for distribution.

Installing X11 and GTK on OS X

GUI apps created with Lazarus that use the GTK widgetset require X11 and the GTK libraries to run. X11 is included with OS X, but may not be installed by default on a user's Mac, so you'll want to mention this in your app's read-me file.

To install the GTK libraries on a user's system, you could include instructions for using fink. Or you could create a separate .dmg file containing just the files from the /sw/lib folder on your Mac. If you don't want to install all of the subfolders under the /sw/lib folder, copy just the .dylib files from /sw/lib to a different folder and package this folder instead of /sw/lib. Also, remember that the GTK libraries installed on your Mac are specific to the version of OS X that you're running. That is, if you want to support both OS X 10.3 and 10.4 you'll need to create two different .dmg files and instruct your users to install the appropriate one. Note that the GTK libraries only need to be installed once and can be used with any number of Lazarus GUI programs that you develop.