%define name flasm
%define version 1.62
%define release 2%{?_dist_release}

Summary: Flash bytecode assembler/disassembler
Summary(ja): Flash バイトコード アセンブラ/逆アセンブラ
Name: %{name}
Version: %{version}
Release: %{release}
License: BSD-like
Group: Development/Tools
URL: http://www.nowrap.de/flasm.html
Source0: http://www.nowrap.de/download/flasm162src.zip
Source1: http://shield.jp/~dseg/rpms/flasm/flasm.1.gz
Patch0:         flasm-1.62-midrule.patch

#Requires: 
BuildRequires: unzip
BuildRequires: bison
BuildRequires: flex
BuildRequires: gperf
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux


%description
Flasm is a free command line assembler/disassembler of Flash ActionScript 
bytecode. It lets you make changes to any SWF. Flasm fully supports SWFs 
produced by Macromedia Flash 8 and earlier Flash versions.

%description -l ja
Flasm は Flash ActionScript バイトコードのフリーなコマンドライン
アセンブラ/逆アセンブラです。 
Flasm によって任意の SWF に変更を加えられます。
Flasm は Macromedia Flash 8 とそれよりも早期の Flash のバージョンによって
生成された SWF を完全にサポートします。


%prep
%setup -q -c
%patch0 -p1 -b .midrule
# cleanup perms and end of lines
chmod -x *.TXT assembler.flex assembler.y *.c *.h *.ini Makefile \
 keywords.gperf logo.gif classic.css flasm.html

# Remove dos end of lines and convert to utf8
%__sed -i 's/\r//' *.TXT classic.css %{name}.html %{name}.ini

# man page associated with another flasm rpm
%__gzip -cd %{SOURCE1} > %{name}.1


%build
# __make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
%__make CFLAGS="$RPM_OPT_FLAGS"


%install
%__rm -rf %{buildroot}
%__install -p -m 0755 -D %{name} %{buildroot}%{_bindir}/%{name}
%__install -p -D %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1


%clean
%__rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%attr(0755,root,root)
%{_bindir}/%{name}
%doc *.TXT classic.css %{name}.html %{name}.ini logo.gif
%{_mandir}/man1/%{name}.1*


%changelog
* Tue Jan 24 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.62-2
- rebuild

* Fri Jul 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.62-1
- applied new versioning policy and spec in utf8
- added BuildRequires: unzip
- applied flasm-1.62-midrule.patch 
  for new bison, give type for $$ in midrule from Fedora development package
- translated %%description -l ja
- changed to %%defattr(-,root,root,-) in %%files

* Wed Jun 27 2007 Atsushi SHICHI <ats777@gmail.com> 1.62-0vl2
- fix permissions of docs. 

* Thu Jun 21 2007 Atsushi SHICHI <ats777@gmail.com> 1.62-0vl1
- initial build for Vine Linux 4.1. Thanks to Daichi Shinozaki.


# end of file
