diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in
index 4a72192..b2699cb 100644
--- a/apkbuild-cpan.in
+++ b/apkbuild-cpan.in
@@ -107,7 +107,7 @@ sub write_apkbuild {
 		pkgname  => map_cpan_to_apk($moddata->{distribution}),
 		pkgreal  => $moddata->{distribution},
 		pkgver  => $moddata->{version},
-		source   => $moddata->{download_url},
+		source   => $moddata->{download_url} =~ s/$moddata->{version}/\$pkgver/r,
 	);
 	$template =~ s/\[% (.*?) %\]/$repl{$1}/g;